Package org.msgpack

Examples of org.msgpack.MessagePack.createBufferPacker()


    public void testModifiersFieldsClassNotNullable(ModifiersFieldsClassNotNullable v) throws Exception {
  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  JavassistTemplateBuilder builder = new JavassistTemplateBuilder(registry);
  Template<ModifiersFieldsClassNotNullable> tmpl = builder.buildTemplate(ModifiersFieldsClassNotNullable.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker();
  unpacker.wrap(bytes);
  ModifiersFieldsClassNotNullable ret = tmpl.read(unpacker, null);
View Full Code Here


    public void testUserDefinedTypeFieldsClass(UserDefinedTypeFieldsClass v) throws Exception {
  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  JavassistTemplateBuilder builder = new JavassistTemplateBuilder(registry);
  Template<UserDefinedTypeFieldsClass> tmpl = builder.buildTemplate(UserDefinedTypeFieldsClass.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker();
  unpacker.wrap(bytes);
  UserDefinedTypeFieldsClass ret = tmpl.read(unpacker, null);
View Full Code Here

    public void testUserDefinedTypeFieldsClassNotNullable(UserDefinedTypeFieldsClassNotNullable v) throws Exception {
  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  JavassistTemplateBuilder builder = new JavassistTemplateBuilder(registry);
  Template<UserDefinedTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(UserDefinedTypeFieldsClassNotNullable.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker();
  unpacker.wrap(bytes);
  UserDefinedTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
View Full Code Here

    public void testInheritanceClass(InheritanceClass v) throws Exception {
  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  JavassistTemplateBuilder builder = new JavassistTemplateBuilder(registry);
  Template<InheritanceClass> tmpl = builder.buildTemplate(InheritanceClass.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker();
  unpacker.wrap(bytes);
  InheritanceClass ret = tmpl.read(unpacker, null);
View Full Code Here

    public void testInheritanceClassNotNullable(InheritanceClassNotNullable v) throws Exception {
  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  JavassistTemplateBuilder builder = new JavassistTemplateBuilder(registry);
  Template<InheritanceClassNotNullable> tmpl = builder.buildTemplate(InheritanceClassNotNullable.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker();
  unpacker.wrap(bytes);
  InheritanceClassNotNullable ret = tmpl.read(unpacker, null);
View Full Code Here

    public void testMessagePackableTypeFieldsClass(MessagePackableTypeFieldsClass v) throws Exception {
  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  JavassistTemplateBuilder builder = new JavassistTemplateBuilder(registry);
  Template<MessagePackableTypeFieldsClass> tmpl = builder.buildTemplate(MessagePackableTypeFieldsClass.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker();
  unpacker.wrap(bytes);
  MessagePackableTypeFieldsClass ret = tmpl.read(unpacker, null);
View Full Code Here

    public void testMessagePackableTypeFieldsClassNotNullable(MessagePackableTypeFieldsClassNotNullable v) throws Exception {
  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  JavassistTemplateBuilder builder = new JavassistTemplateBuilder(registry);
  Template<MessagePackableTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(MessagePackableTypeFieldsClassNotNullable.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker();
  unpacker.wrap(bytes);
  MessagePackableTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
View Full Code Here

  TemplateRegistry registry = new TemplateRegistry();
  registry.register(EnumTypeFieldsClass.SampleEnum.class,
    new OrdinalEnumTemplateBuilder(registry).buildTemplate(EnumTypeFieldsClass.SampleEnum.class));
  ReflectionTemplateBuilder builder = new ReflectionTemplateBuilder(registry);
  Template<EnumTypeFieldsClass> tmpl = builder.buildTemplate(EnumTypeFieldsClass.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker();
  unpacker.wrap(bytes);
  EnumTypeFieldsClass ret = tmpl.read(unpacker, null);
View Full Code Here

  TemplateRegistry registry = new TemplateRegistry();
  registry.register(EnumTypeFieldsClassNotNullable.SampleEnum.class,
    new OrdinalEnumTemplateBuilder(registry).buildTemplate(EnumTypeFieldsClassNotNullable.SampleEnum.class));
  ReflectionTemplateBuilder builder = new ReflectionTemplateBuilder(registry);
  Template<EnumTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(EnumTypeFieldsClassNotNullable.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker();
  unpacker.wrap(bytes);
  EnumTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
View Full Code Here

    public void testPrimitiveTypeFieldsClass(PrimitiveTypeFieldsClass v) throws Exception {
  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  JavassistTemplateBuilder builder = new JavassistTemplateBuilder(registry);
  Template<PrimitiveTypeFieldsClass> tmpl = builder.buildTemplate(PrimitiveTypeFieldsClass.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  PrimitiveTypeFieldsClass ret = tmpl.read(unpacker, null);
  assertEquals(v, ret);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.