Package org.msgpack.packer

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


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


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

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

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

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