i1+=8; int i2 = contentType.indexOf(' ',i1);
int i8=i1+8; int i2 = type_params.indexOf(' ',i8);
    public void setContentType(String contentType)    {        if (isCommitted())            return;        if (contentType==null)        {            if (_locale==null)                _characterEncoding=null;            _mimeType=null;            _cachedMimeType=null;            _contentType=null;            _connection.getResponseFields().remove(HttpHeaders.CONTENT_TYPE_BUFFER);        }        else        {            // Look for encoding in contentType            int i0=contentType.indexOf(';');            // TODO lookup combinations in cache            if (i0>0)            {                // Strip params off mimetype                _mimeType=contentType.substring(0,i0).trim();                _cachedMimeType=MimeTypes.CACHE.get(_mimeType);                // Look for charset                int i1=contentType.indexOf("charset=",i0);                if (i1>=0)                {                    i1+=8;                    int i2 = contentType.indexOf(' ',i1);                    _characterEncoding = (0<i2)                        ? contentType.substring(i1,i2)                        : contentType.substring(i1);                    _characterEncoding = QuotedStringTokenizer.unquote(_characterEncoding);                    _contentType=contentType;                }                else // No encoding in the params.                {                    _contentType=null;                }            }            else // No encoding and no other params            {                _mimeType=contentType;                _cachedMimeType=MimeTypes.CACHE.get(_mimeType);                _contentType=null;            }            // combine mime type and encoding            if (_characterEncoding==null)            {                if (_cachedMimeType!=null)                {                    _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_cachedMimeType);                    _contentType=_cachedMimeType.toString();                }            }            else            {                if(_cachedMimeType!=null)                {                    CachedBuffer content_type = _cachedMimeType.getAssociate(_characterEncoding);                    if (content_type!=null)                    {                        _contentType=content_type.toString();                        _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,content_type);                    }                    else                    {                        if (_contentType==null)                            _contentType = _mimeType+";charset="+QuotedStringTokenizer.quote(_characterEncoding,";= ");                        _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);                    }                }                else                {                    if (_contentType==null)                        _contentType = _mimeType+";charset="+QuotedStringTokenizer.quote(_characterEncoding,";= ");                    _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);                }            }        }    }