code: @Override
    public void write(byte []buf, int offset, int length, boolean isEnd)
      throws IOException
    {
      while (length > 0) {
        if (_tail == null) {
          addBuffer(TempBuffer.create());
        }
        else if (_tail.buffer().length <= _tail.length()) {
          addBuffer(TempBuffer.create());
        }
        
        TempBuffer tail = _tail;
  
        int sublen = Math.min(length, tail.buffer().length - tail.length());
  
        System.arraycopy(buf, offset, tail.buffer(), tail.length(), sublen);
  
        length -= sublen;
        offset += sublen;
        _tail.length(_tail.length() + sublen);
      }
    }
docs: Writes a chunk of data to the temp stream.