public void writeTo ( java . io . OutputStream os , int start_offset , int length ) throws IOException { int towrite = min ( length , _write_pos - start_offset ) ; int writeoff = start_offset ; if ( towrite > 0 ) { while ( towrite >= _window_size ) { moveWindow ( writeoff ) ; os . write ( _memory_buffer , 0 , _window_size ) ; towrite -= _window_size ; writeoff += _window_size ; } if ( towrite > 0 ) { moveWindow ( writeoff ) ; os . write ( _memory_buffer , 0 , towrite ) ; } } }
Writes efficiently part of the content to output stream .