Examples of createUnpacker()


Examples of org.msgpack.MessagePack.createUnpacker()

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

Examples of org.msgpack.MessagePack.createUnpacker()

      Template<Map<K, V>> tmpl = new MapTemplate(keyElementTemplate, valueElementTemplate);
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      Packer packer = msgpack.createPacker(out);
      tmpl.write(packer, v);
      byte[] bytes = out.toByteArray();
      Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
      Map<K, V> ret = tmpl.read(unpacker, null);
      assertEquals(v, ret);
  }
    }
View Full Code Here

Examples of org.msgpack.MessagePack.createUnpacker()

      Template<int[]> tmpl = IntegerArrayTemplate.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));
      int[] ret0;
      switch (index) {
      case 0:
    ret0 = null;
    break;
View Full Code Here

Examples of org.msgpack.MessagePack.createUnpacker()

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

Examples of org.msgpack.MessagePack.createUnpacker()

      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

Examples of org.msgpack.MessagePack.createUnpacker()

  ReflectionTemplateBuilder builder = new ReflectionTemplateBuilder(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);
    }

    @Test @Override
View Full Code Here

Examples of org.msgpack.MessagePack.createUnpacker()

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

    @Test @Override
View Full Code Here

Examples of org.msgpack.MessagePack.createUnpacker()

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

    @Test @Override
View Full Code Here

Examples of org.msgpack.MessagePack.createUnpacker()

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

    @Test @Override
View Full Code Here

Examples of org.msgpack.MessagePack.createUnpacker()

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

    @Test @Override
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.