question: public static int copy ( Reader in , Writer out ) throws IOException { Preconditions . checkNotNull ( in , "No Reader specified" ) ; Preconditions . checkNotNull ( out , "No Writer specified" ) ; try { int byteCount = 0 ; char [ ] buffer = new char [ BUFFER_SIZE ] ; int bytesRead ; while ( ( bytesRead = in . read ( buffer ) ) != - 1 ) { out . write ( buffer , 0 , bytesRead ) ; byteCount += bytesRead ; } out . flush ( ) ; return byteCount ; } finally { try { in . close ( ) ; } catch ( IOException ex ) { } try { out . close ( ) ; } catch ( IOException ex ) { } } }
target:  Copy the contents of the given Reader to the given Writer. Closes both when done.