Package org.msgpack.packer

Examples of org.msgpack.packer.Packer.writeInt()


    @Override
    public void testInteger(int v) throws Exception {
  MessagePack msgpack = new JSON();
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
  packer.writeInt(v);
  byte[] bytes = out.toByteArray();
  Unpacker unpacker = msgpack.createBufferUnpacker(bytes);
  int ret = unpacker.readInt();
  assertEquals(v, ret);
    }
View Full Code Here


    @Override
    public void testInteger(int v) throws Exception {
  MessagePack msgpack = new JSON();
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
  packer.writeInt(v);
  byte[] bytes = out.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  int ret = unpacker.readInt();
  assertEquals(v, ret);
    }
View Full Code Here

    @Override
    public void testInteger(int v) throws Exception {
  MessagePack msgpack = new MessagePack();
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
  packer.writeInt(v);
  ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
  Unpacker unpacker = msgpack.createUnpacker(in);
  int ret = unpacker.readInt();
  assertEquals(v, ret);
    }
View Full Code Here

    @Override
    public void testInteger(int v) throws Exception {
  MessagePack msgpack = new MessagePack();
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
  packer.writeInt(v);
  byte[] bytes = out.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
  Value value = unpacker.readValue();
  assertTrue(value.isInteger());
  int ret = new Converter(value).readInt();
View Full Code Here

    @Override
    public void testInteger(int v) throws Exception {
  MessagePack msgpack = new MessagePack();
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
  packer.writeInt(v);
  byte[] bytes = out.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
  int ret = unpacker.readInt();
  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.