Package org.msgpack

Examples of org.msgpack.MessagePack.createPacker()


  @Override
  public void testIntegerArray(int[] v) throws Exception {
      MessagePack msgpack = new MessagePack();
      Template<int[]> tmpl = IntegerArrayTemplate.instance;
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      Packer packer = msgpack.createPacker(out);
      tmpl.write(packer, v);
      byte[] bytes = out.toByteArray();
      BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
      int[] ret0;
      switch (index) {
View Full Code Here


  @Override
  public void testBoolean(boolean v) throws Exception {
      MessagePack msgpack = new MessagePack();
      Template<Boolean> tmpl = BooleanTemplate.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));
      boolean ret = tmpl.read(unpacker, null);
      assertEquals(v, ret);
View Full Code Here

  @Override
  public void testBoolean(boolean v) throws Exception {
      MessagePack msgpack = new MessagePack();
      Template<Boolean> tmpl = BooleanTemplate.instance;
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      Packer packer = msgpack.createPacker(out);
      tmpl.write(packer, v);
      byte[] bytes = out.toByteArray();
      BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
      boolean ret = tmpl.read(unpacker, null);
      assertEquals(v, ret);
View Full Code Here

  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
  Template<PrimitiveTypeFieldsClass> tmpl = builder.buildTemplate(PrimitiveTypeFieldsClass.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);
  PrimitiveTypeFieldsClass ret = tmpl.read(unpacker, null);
View Full Code Here

  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(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);
View Full Code Here

  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
  Template<ReferenceTypeFieldsClass> tmpl = builder.buildTemplate(ReferenceTypeFieldsClass.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);
  ReferenceTypeFieldsClass ret = tmpl.read(unpacker, null);
View Full Code Here

  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
  Template<ReferenceTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(ReferenceTypeFieldsClassNotNullable.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);
  ReferenceTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
View Full Code Here

  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
  Template<ListTypeFieldsClass> tmpl = builder.buildTemplate(ListTypeFieldsClass.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);
  ListTypeFieldsClass ret = tmpl.read(unpacker, null);
View Full Code Here

  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
  Template<ListTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(ListTypeFieldsClassNotNullable.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);
  ListTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
View Full Code Here

  MessagePack msgpack = new MessagePack();
  TemplateRegistry registry = new TemplateRegistry();
  ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
  Template<MapTypeFieldsClass> tmpl = builder.buildTemplate(MapTypeFieldsClass.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);
  MapTypeFieldsClass ret = tmpl.read(unpacker, null);
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.