public static String read ( InputStream input ) { try { StringBuilder bld = new StringBuilder ( ) ; Reader reader = new InputStreamReader ( input , "utf-8" ) ; int ch ; while ( ( ch = reader . read ( ) ) >= 0 ) bld . append ( ( char ) ch ) ; return bld . toString ( ) ; } catch ( IOException ex ) { throw new RuntimeException ( ex ) ; } }
Reads an input stream into a String encoding with UTF - 8