MessagePacker messagePacker = getMessagePacker();
if (v == null) {
messagePacker.packNil();
}
else if (v instanceof Integer) {
messagePacker.packInt((Integer) v);
}
else if (v instanceof ByteBuffer) {
ByteBuffer bb = (ByteBuffer) v;
messagePacker.packBinaryHeader(bb.limit());
messagePacker.writePayload(bb);