code: public void writeTo(WritableByteChannel out) throws IOException {
  		int n1 = _flushPosition / _bufferSize;
  		int n2 = _buffers.size();
  		int toWrite = _size - _flushPosition;
  		while (n1 < n2) {
  			int curWrite = Math.min(toWrite, _bufferSize);
  			ByteBuffer bb = _buffers.get(n1);
  			bb.position(curWrite);
  			bb.flip();
  			out.write(bb);
  			++n1;
  			toWrite -= curWrite;
  		}
  	}
docs: Writes all non-flushed internal buffers to the given channel.
  If {@link #flushTo(WritableByteChannel)} has not been called
  before, this method writes the whole buffer to the channel.
  @param out the channel to write to
  @throws IOException if the buffer could not be written