private InputStreamReader downloadUrl ( String urlString ) throws IOException { URL url = new URL ( urlString ) ; HttpURLConnection conn = ( HttpURLConnection ) url . openConnection ( ) ; conn . setReadTimeout ( 10000 /* milliseconds */ ) ; conn . setConnectTimeout ( 15000 /* milliseconds */ ) ; conn . setRequestMethod ( "GET" ) ; conn . setDoInput ( true ) ; // Starts the query conn . connect ( ) ; return new InputStreamReader ( conn . getInputStream ( ) , "UTF-8" ) ; }
an input stream .