// 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 =
CodedOutputStream.newInstance(payload.array(), 4 + offset,
1 + pblen);
output.writeRawByte(pblen); // varint but always on 1 byte here.
header.writeTo(output);
output.checkNoSpaceLeft();
} catch (IOException e) {