Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
/** * copy character stream with given buffer size */ static void copy( Reader from, Writer to, int bufferSize ) throws IOException { char[] buffer = new char[ bufferSize ]; int bufferLen = 0; while ( ( bufferLen = from.read( buffer ) ) >= 0 ) { to.write( buffer, 0, bufferLen ); } to.flush(); }
Pasted July 06, 200811:06AM EDT
Embed