Package org.msgpack

Examples of org.msgpack.MessagePack.createUnpacker()


  ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
  Template<InheritanceClass> tmpl = builder.buildTemplate(InheritanceClass.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  InheritanceClass ret = tmpl.read(unpacker, null);
  assertEquals(v, ret);
    }

    @Test @Override
View Full Code Here


  ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
  Template<InheritanceClassNotNullable> tmpl = builder.buildTemplate(InheritanceClassNotNullable.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  InheritanceClassNotNullable ret = tmpl.read(unpacker, null);
  assertEquals(v, ret);
    }

    @Test @Override
View Full Code Here

  ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
  Template<MessagePackableTypeFieldsClass> tmpl = builder.buildTemplate(MessagePackableTypeFieldsClass.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  MessagePackableTypeFieldsClass ret = tmpl.read(unpacker, null);
  assertEquals(v, ret);
    }

    @Test @Override
View Full Code Here

  ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
  Template<MessagePackableTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(MessagePackableTypeFieldsClassNotNullable.class);
  BufferPacker packer = msgpack.createBufferPacker();
  tmpl.write(packer, v);
  byte[] bytes = packer.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  MessagePackableTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
  assertEquals(v, ret);
    }

}
View Full Code Here

  Template<EnumTypeFieldsClass> tmpl = builder.buildTemplate(EnumTypeFieldsClass.class);
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
  tmpl.write(packer, v);
  byte[] bytes = out.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  EnumTypeFieldsClass ret = tmpl.read(unpacker, null);
  assertEquals(v, ret);
    }

    @Test @Override
View Full Code Here

  Template<EnumTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(EnumTypeFieldsClassNotNullable.class);
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
  tmpl.write(packer, v);
  byte[] bytes = out.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  EnumTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
  assertEquals(v, ret);
    }
}
View Full Code Here

      MessagePack msgpack = new MessagePack();
      Template<Boolean> tmpl = BooleanTemplate.instance;     
      BufferPacker packer = msgpack.createBufferPacker();
      tmpl.write(packer, v);
      byte[] bytes = packer.toByteArray();
      Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
      boolean ret = tmpl.read(unpacker, null);
      assertEquals(v, ret);
  }
    }
}
View Full Code Here

      Template<short[]> tmpl = ShortArrayTemplate.instance;
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      Packer packer = msgpack.createPacker(out);
      tmpl.write(packer, v);
      byte[] bytes = out.toByteArray();
      Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
      short[] ret0;
      switch (index) {
      case 0:
    ret0 = null;
    break;
View Full Code Here

      MessagePack msgpack = new MessagePack();
      Template<short[]> tmpl = ShortArrayTemplate.instance;
      BufferPacker packer = msgpack.createBufferPacker();
      tmpl.write(packer, v);
      byte[] bytes = packer.toByteArray();
      Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
      short[] ret0;
      switch (index) {
      case 0:
    ret0 = null;
    break;
View Full Code Here

      Template<long[]> tmpl = LongArrayTemplate.instance;
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      Packer packer = msgpack.createPacker(out);
      tmpl.write(packer, v);
      byte[] bytes = out.toByteArray();
      Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
      long[] ret0;
      switch (index) {
      case 0:
    ret0 = null;
    break;
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.