question: public static CharArrayWriter readAllCharsFromReader ( Reader reader ) throws IOException { try { final int BUFFER_SIZE = 1024 ; char [ ] buffer = new char [ BUFFER_SIZE ] ; CharArrayWriter chars = new CharArrayWriter ( ) ; int read ; while ( ( read = reader . read ( buffer ) ) != EOF ) { chars . write ( buffer , 0 , read ) ; } return chars ; } finally { reader . close ( ) ; } }
target:  Reads and returns all chars from given reader until an EOF is read. Closes reader afterwards. 