private static String _toCharArray ( InputStream stream ) throws IOException { InputStreamReader is = new InputStreamReader ( stream , "UTF-8" ) ; StringBuilder builder = new StringBuilder ( ) ; char [ ] buf = new char [ 1000 ] ; int l = 0 ; while ( l >= 0 ) { builder . append ( buf , 0 , l ) ; l = is . read ( buf ) ; } is . close ( ) ; return builder . toString ( ) ; }
Reads the InputStream as UTF - 8