public void addIntHeader(String name, int value) throws HttpException {
   try {
     request.writeIntHeader(name, value);
   } catch (IOException ex) {
     throw new HttpConnectionException(ex);
   }
 }
 public void send(String contentType, byte[] content) throws HttpException {
   if (headersProvider != null) {
     headersProvider.writeHeaders(this);
   }
   try {
     request.writeHeader(HttpConstants.Headers.CONTENT_TYPE, contentType);
     request.writeIntHeader(HttpConstants.Headers.CONTENT_LENGTH, content.length);
     request.writeLine("");
     request.write(content);
     request.flush();
     status = Status.COMPLETE;
   } catch (IOException ex) {
     throw new HttpConnectionException(ex);
   }
 }