question: public long writeValue ( OutputStream out ) throws IOException { DataInputStream dis = getValueStream ( ) ; long size = 0 ; try { int chunkSize ; while ( ( chunkSize = valueBufferInputStream . getRemain ( ) ) > 0 ) { chunkSize = Math . min ( chunkSize , MAX_VAL_TRANSFER_BUF_SIZE ) ; valTransferBuffer . setSize ( chunkSize ) ; dis . readFully ( valTransferBuffer . getBytes ( ) , 0 , chunkSize ) ; out . write ( valTransferBuffer . getBytes ( ) , 0 , chunkSize ) ; size += chunkSize ; } return size ; } finally { dis . close ( ) ; } }
target:  Writing the value to the output stream. This method avoids copying value data from Scanner into user buffer, then writing to the output stream. It does not require the value length to be known.