public static InputStream getContentStream ( String stringUrl ) throws MalformedURLException , IOException { URL url = new URL ( stringUrl ) ; URLConnection urlConnection = url . openConnection ( ) ; InputStream is = urlConnection . getInputStream ( ) ; if ( "gzip" . equals ( urlConnection . getContentEncoding ( ) ) ) { is = new GZIPInputStream ( is ) ; } return is ; }
Get stream for URL only