Java examples for Network:URL Download
get Stream From URL
//package com.java2s; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; public class Main { public static InputStream getStreamFromURL(String imageURL) { InputStream in = null;// ww w .ja v a 2s.co m try { URL url = new URL(imageURL); HttpURLConnection connection = (HttpURLConnection) url .openConnection(); in = connection.getInputStream(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return in; } }