code: public void writeHeader(HttpMessage httpMessage) throws IOException
      {
          HttpResponse response=(HttpResponse)httpMessage;
          response.setState(HttpMessage.__MSG_SENDING);
  
          _ajpResponse.resetData();
          _ajpResponse.addByte(AJP13ResponsePacket.__SEND_HEADERS);
          _ajpResponse.addInt(response.getStatus());
          _ajpResponse.addString(response.getReason());
  
          int mark=_ajpResponse.getMark();
          _ajpResponse.addInt(0);
          int nh=0;
          Enumeration e1=response.getFieldNames();
          while (e1.hasMoreElements())
          {
              String h=(String)e1.nextElement();
              Enumeration e2=response.getFieldValues(h);
              while (e2.hasMoreElements())
              {
                  _ajpResponse.addHeader(h);
                  _ajpResponse.addString((String)e2.nextElement());
                  nh++;
              }
          }
  
          if (nh>0)
              _ajpResponse.setInt(mark,nh);
          _ajpResponse.setDataSize();
  
          write(_ajpResponse);
  
          _ajpResponse.resetData();
      }
docs: /* ------------------------------------------------------------