code: 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);
              }
          }
      }
docs: Writes efficiently part of the content to output stream.
  @param os OutputStream to write to
  @param start_offset  Offset of data fragment to be written
  @param length        Length of data fragment to be written
  @throws IOException