private static long copy ( Reader input , StringBuilder output , char [ ] buffer ) throws IOException { long bytesTransferred = 0 ; int bytesRead = 0 ; while ( EOF != ( bytesRead = input . read ( buffer ) ) ) { output . append ( buffer , 0 , bytesRead ) ; bytesTransferred += bytesRead ; } return bytesTransferred ; }
Transfers data from Reader into StringBuilder