// header itself is.
final int offset = 19 + method.length - pblen - 1;
assert offset >= 0 : ("RPC header too big (" + pblen + " bytes): "
+ header);
// Skip the few extraneous bytes we over-allocated for the header.
payload.readerIndex(offset);
// The first int is the size of the message, excluding the 4 bytes
// needed for the size itself, hence the `-4'.
payload.setInt(offset, payload.readableBytes() - 4); // 4 bytes
try {
final CodedOutputStream output =