@Override
    public void write(byte[] data) {
        if (connection == null) {
            connect();
        }
        try {
            if (outputStream == null) {
                outputStream = connection.getOutputStream();
            }
            connection.getOutputStream().write(data);
        } catch (IOException e) {
            connection.disconnect();
            handler.handle(AsyncResultImpl.<IHttpClientResponse>create(e));
            throw new RuntimeException(e);
        }
    }
@see io.apiman.gateway.engine.components.http.IHttpClientRequest#write(byte[])
gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/components/HttpClientRequestImpl.java