code: @Override
    public void write(byte []buf, int offset, int length, boolean isEnd)
      throws IOException
    {
      while (offset < length) {
        TempBuffer tail = _tail;
        
        if (tail == null || tail.buffer().length <= tail.length()) {
          addBuffer(TempBuffer.create());
          tail = _tail;
        }
        
        int tailLength = tail.length();
        
        
        byte []tailBuffer = tail.buffer();
  
        int sublen = tailBuffer.length - tailLength;
        if (length - offset < sublen) {
          sublen = length - offset;
        }
  
        System.arraycopy(buf, offset, tailBuffer, tailLength, sublen);
  
        offset += sublen;
        tail.length(tailLength + sublen);
      }
    }
docs: Writes a buffer to the underlying stream.
  
  @param buffer the byte array to write.
  @param offset the offset into the byte array.
  @param length the number of bytes to write.
  @param isEnd true when the write is flushing a close.