{  if (_noContent) { content.clear(); return; }  if (content.isImmutable()) throw new IllegalArgumentException("immutable");  if (_last||_state==STATE_END) { Log.debug("Ignoring extra content {}",content); content.clear(); return; } _last=last;   if (_content!=null&&_content.length()>0)
    public void addContent(Buffer content, boolean last) throws IOException    {        if (_noContent)        {            content.clear();            return;        }        if (content.isImmutable())            throw new IllegalArgumentException("immutable");        if (_last||_state==STATE_END)        {            Log.debug("Ignoring extra content {}",content);            content.clear();            return;        }        _last=last;        // Handle any unfinished business?        if (_content!=null&&_content.length()>0)        {            flush();            if (_content!=null&&_content.length()>0)                throw new IllegalStateException("FULL");        }        _content=content;        _contentWritten+=content.length();        // Handle the _content        if (_head)        {            content.clear();            _content=null;        }        else        {            // Yes - so we better check we have a buffer            initContent();            // Copy _content to buffer;            int len=0;            len=_buffer.put(_content);            // make sure there is space for a trailing null            if (len>0&&_buffer.space()==0)            {                len--;                _buffer.setPutIndex(_buffer.putIndex()-1);            }            _content.skip(len);            if (_content.length()==0)                _content=null;        }    }