Package org.msgpack.packer

Examples of org.msgpack.packer.BufferPacker.writeShort()


    @Override
    public void testShort(short v) throws Exception {
  MessagePack msgpack = new JSON();
  BufferPacker packer = msgpack.createBufferPacker();
  packer.writeShort(v);
  byte[] bytes = packer.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  short ret = unpacker.readShort();
  assertEquals(v, ret);
    }
View Full Code Here


    @Override
    public void testShort(short v) throws Exception {
  MessagePack msgpack = new JSON();
  BufferPacker packer = msgpack.createBufferPacker();
  packer.writeShort(v);
  byte[] bytes = packer.toByteArray();
        Unpacker unpacker = msgpack.createBufferUnpacker(bytes);
  short ret = unpacker.readShort();
  assertEquals(v, ret);
    }
View Full Code Here

    @Override
    public void testShort(short v) throws Exception {
  MessagePack msgpack = new MessagePack();
  BufferPacker packer = msgpack.createBufferPacker();
  packer.writeShort(v);
  byte[] bytes = packer.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  short ret = unpacker.readShort();
  assertEquals(v, ret);
    }
View Full Code Here

    @Override
    public void testShort(short v) throws Exception {
  MessagePack msgpack = new MessagePack();
  BufferPacker packer = msgpack.createBufferPacker();
  packer.writeShort(v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
  short ret = unpacker.readShort();
  assertEquals(v, ret);
    }
View Full Code Here

    @Override
    public void testShort(short v) throws Exception {
  MessagePack msgpack = new MessagePack();
  BufferPacker packer = msgpack.createBufferPacker();
  packer.writeShort(v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
  Value value = unpacker.readValue();
  assertTrue(value.isInteger());
  short ret = new Converter(value).readShort();
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.