private ByteBuffer writeRequest(String methodName, Object argument) throws IOException {
    ByteArrayOutputStream requestStream = new ByteArrayOutputStream();

    streamClient.invoke(methodName, argument, requestStream);
    log.trace("Raw request payload: " + requestStream.toString());

    return ByteBuffer.wrap(requestStream.toByteArray());
  }
Serialize a JSON-RPC request into a ByteBuffer for use as a Lambda request payload.

@throws IOException if serializing the request payload fails
json-rpc-lambda-client/src/main/java/com/amazonaws/blox/jsonrpc/JsonRpcLambdaClient.java