Here you can find the source of getImageFromURL(String remoteURL)
public static InputStream getImageFromURL(String remoteURL) throws Exception
//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; } }