Java URL Connection getImageFromURL(String remoteURL)

Here you can find the source of getImageFromURL(String remoteURL)

Description

get Image From URL

License

Open Source License

Declaration

public static InputStream getImageFromURL(String remoteURL) throws Exception 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;
import java.net.URL;
import java.net.URLConnection;

public class Main {
    public static InputStream getImageFromURL(String remoteURL) throws Exception {
        InputStream inputStream = null;
        try {//from w  w  w .  java 2s  .co m
            URL url = new URL(remoteURL);
            URLConnection conn = url.openConnection();
            inputStream = conn.getInputStream();
        } catch (Exception e) {
            e.printStackTrace();
        }

        return inputStream;
    }
}

Related

  1. getHTML(String url, boolean removeNonLatinChars)
  2. getHTML(URL url)
  3. getHttpGetContent(String strUrl, String charSet)
  4. getHttpHeaders(URLConnection connection)
  5. getHttpResponseHeader(URLConnection http)
  6. getJar(String jarUrl)
  7. getJarUrlForPackage(String packageName)
  8. getLastModified(URL url)
  9. getLastModified(URLConnection connection)