question: public static void copy ( Reader reader , boolean closeIn , Appendable out ) throws IOException { try { CharBuffer buffer = CharBuffer . allocate ( 4096 ) ; while ( reader . read ( buffer ) > 0 ) { buffer . flip ( ) ; buffer . rewind ( ) ; out . append ( buffer ) ; } } finally { if ( closeIn ) IOUtils . closeQuietly ( reader ) ; } }
target:  Copy a Reader to an Appendable, optionally closing the input.