public static String read ( Reader reader ) throws IOException { final char [ ] buffer = new char [ 1024 ] ; StringBuilder sb = new StringBuilder ( ) ; int len ; while ( ( len = reader . read ( buffer ) ) != - 1 ) { sb . append ( buffer , 0 , len ) ; } return sb . toString ( ) ; }
Returns a string from the specified Reader object .