MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry();
ReflectionTemplateBuilder builder = new ReflectionTemplateBuilder(registry);
Template<PrimitiveTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(PrimitiveTypeFieldsClassNotNullable.class);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Packer packer = msgpack.createPacker(out);
tmpl.write(packer, v);
byte[] bytes = out.toByteArray();
BufferUnpacker unpacker = msgpack.createBufferUnpacker();
unpacker.wrap(bytes);
PrimitiveTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);