question: public static String readAsString ( InputStream is ) throws IOException { StringBuffer buf = new StringBuffer ( ) ; byte [ ] b = new byte [ 8192 ] ; int nread = - 1 ; while ( ( nread = is . read ( b ) ) >= 0 ) { String s = new String ( b , 0 , nread ) ; buf . append ( s ) ; } return buf . toString ( ) ; }
target:  Reads an input stream into a single String result.