private static ByteBuf convertBody(final HttpRequest request) {
        final Object body = request.getBody();
        if (body instanceof byte[]) {
            request.headers().put(HttpRequest.Headers.CONTENT_LENGTH, String.valueOf(((byte[]) body).length));
            return Unpooled.wrappedBuffer((byte[]) body);
        } else {
            throw new IllegalArgumentException("Final body must be byte[] but found "
                    + body.getClass().getSimpleName());
        }
    }
Converts {@link RequestMessage} to a {@code HttpRequest}.
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/handler/HttpGremlinRequestEncoder.java