code: public void processSend(ByteBuffer content) {
          LOG.entering(CLASS_NAME, "processSend", content);
          if (readyState != State.OPENED && readyState != State.HEADERS_RECEIVED) {
              throw new IllegalStateException(readyState + " HttpRequest must be in an OPEN state before " + "invocation of the send() method");
          }
          try {
              if (!async && content != null && content.hasRemaining()) {
                  connection.setDoOutput(true);
                  connection.setDoInput(true);
                  
                  OutputStream out = connection.getOutputStream(); 
                  out.write(content.array(), content.arrayOffset(), content.remaining());
                  out.flush();
              }
              
              connection.connect();
              reader = new StreamReader();
              Thread t = new Thread(reader, "HttpRequestDelegate stream reader");
              t.setDaemon(true);
              t.start();
          }
          catch (Exception e) {
              LOG.log(Level.FINE, "While processing http request", e); 
              // e.printStackTrace();
              listener.errorOccurred(new ErrorEvent(e));
          }
      }
docs: /* (non-Javadoc)
  @see org.kaazing.gateway.client.transport.http.HttpRequestDelegate#send(java.nio.ByteBuffer)