question: public static String readFully ( final Reader reader ) throws IOException { try { final StringWriter writer = new StringWriter ( ) ; final char [ ] buffer = new char [ 1024 ] ; int count ; while ( ( count = reader . read ( buffer ) ) != - 1 ) { writer . write ( buffer , 0 , count ) ; } return writer . toString ( ) ; } finally { reader . close ( ) ; } }
target:  Returns the remainder of 'reader' as a string, closing it when done.