question: public static void writeUnsafe ( PacketOutputStream out , InputStream is , long length , boolean noBackslashEscapes ) throws IOException { out . writeUnsafe ( QUOTE ) ; byte [ ] buffer = new byte [ 1024 ] ; long bytesLeft = length ; int len ; for ( ; ; ) { int bytesToRead = ( int ) Math . min ( bytesLeft , buffer . length ) ; if ( bytesToRead == 0 ) { break ; } len = is . read ( buffer , 0 , bytesToRead ) ; if ( len <= 0 ) { break ; } writeBytesEscapedUnsafe ( out , buffer , len , noBackslashEscapes ) ; bytesLeft -= len ; } out . writeUnsafe ( QUOTE ) ; }
target:  Write stream in text format without checking buffer size.