System.out.println("0x"+TypeUtil.toHexString(codes)+":"+f.getName()+": "+f.getValue());
    public void completeHeader(HttpFields fields, boolean allContentAdded) throws IOException    {        if (_state != STATE_HEADER) return;        if (_last && !allContentAdded) throw new IllegalStateException("last?");        _last = _last | allContentAdded;        boolean has_server = false;            if (_version == HttpVersions.HTTP_1_0_ORDINAL)             _close = true;        // get a header buffer        if (_header == null)             _header = _buffers.getBuffer(_headerBufferSize);        Buffer tmpbuf=_buffer;        _buffer=_header;                try        {            // start the header            _buffer.put((byte)'A');            _buffer.put((byte)'B');            addInt(0);            _buffer.put((byte)0x4);            addInt(_status);            if (_reason==null)                _reason=getReason(_status);            if (_reason==null)                _reason=TypeUtil.toString(_status);            addString(_reason);            if (_status==100 || _status==204 || _status==304)            {                _noContent=true;                _content=null;                if (_buffer!=null)                    _buffer.clear();            }            // allocate 2 bytes for number of headers            int field_index=_buffer.putIndex();            addInt(0);            // Add headers            System.out.println("********* Start of Response Headers **********");            Iterator i=fields.getFields();            int num_fields=0;            while (i.hasNext())            {                num_fields++;                Field f=(Field)i.next();                byte[] codes=(byte[])__headerHash.get(f.getName());                if (codes!=null)                {                    System.out.println("0x"+TypeUtil.toHexString(codes)+":"+f.getName()+": "+f.getValue());                    _buffer.put(codes);                }                else                {                    System.out.println(f.getName()+": "+f.getValue());                    addString(f.getName());                }                addString(f.getValue());            }            if (!has_server && _status>100 && getSendServerVersion())            {                num_fields++;                addString("Server");                addString(SERVER);            }            // TODO Add content length if last content known.            System.out.println("********* END of Response Headers **********");            // insert the number of headers            int tmp=_buffer.putIndex();            _buffer.setPutIndex(field_index);            addInt(num_fields);            _buffer.setPutIndex(tmp);            // get the payload size ( - 4 bytes for the ajp header) excluding the            // ajp header            int payloadSize=_buffer.length()-4;            // insert the total packet size on 2nd and 3rd byte that was previously            // allocated            addInt(2,payloadSize);        }        finally        {            _buffer=tmpbuf;        }        _state = STATE_CONTENT;    }