code: @Override
    public void write(byte []buffer, int offset, int length)
    {
      if (isClosed() || isHead()) {
        return;
      }
  
      int byteLength = _offset;
      
      while (true) {
        int sublen = Math.min(length, SIZE - byteLength);
  
        System.arraycopy(buffer, offset, _buffer, byteLength, sublen);
        offset += sublen;
        length -= sublen;
        byteLength += sublen;
        
        if (length <= 0) {
          break;
        }
        
        _offset = byteLength;
        flushByteBuffer();
        byteLength = _offset;
      }
  
      _offset = byteLength;
    }
docs: Writes a chunk of bytes to the stream.