Package org.msgpack.unpacker

Examples of org.msgpack.unpacker.Converter


    public void testDouble(double v) throws Exception {
  MessagePack msgpack = new MessagePack();
        Unconverter packer = new Unconverter(msgpack);
        packer.writeDouble(v);
        Value r = packer.getResult();
        Converter unpacker = new Converter(msgpack, r);
        Value ret = unpacker.readValue();
  assertEquals(r, ret);
    }
View Full Code Here


    public void testNil() throws Exception {
  MessagePack msgpack = new MessagePack();
        Unconverter packer = new Unconverter(msgpack);
        packer.writeNil();
        Value r = packer.getResult();
        Converter unpacker = new Converter(msgpack, r);
        unpacker.readNil();
    }
View Full Code Here

    public void testBigInteger(BigInteger v) throws Exception {
  MessagePack msgpack = new MessagePack();
        Unconverter packer = new Unconverter(msgpack);
        packer.writeBigInteger(v);
        Value r = packer.getResult();
        Converter unpacker = new Converter(msgpack, r);
        Value ret = unpacker.readValue();
        assertEquals(r, ret);
    }
View Full Code Here

    public void testString(String v) throws Exception {
  MessagePack msgpack = new MessagePack();
        Unconverter packer = new Unconverter(msgpack);
        packer.writeString(v);
        Value r = packer.getResult();
        Converter unpacker = new Converter(msgpack, r);
        Value ret = unpacker.readValue();
        assertEquals(r, ret);
    }
View Full Code Here

    public void testByteArray(byte[] v) throws Exception {
  MessagePack msgpack = new MessagePack();
        Unconverter packer = new Unconverter(msgpack);
        packer.writeByteArray(v);
        Value r = packer.getResult();
        Converter unpacker = new Converter(msgpack, r);
        Value ret = unpacker.readValue();
  assertEquals(r, ret);
    }
View Full Code Here

          packer.write(o);
            }
            packer.writeArrayEnd();
        }
        Value r = packer.getResult();
  Converter unpacker = new Converter(msgpack, r);
  if (unpacker.trySkipNil()) {
      assertEquals(null, v);
      return;
  }
        Value ret = unpacker.readValue();
        assertEquals(r, ret);
    }
View Full Code Here

          packer.write(e.getValue());
            }
            packer.writeMapEnd();
        }
        Value r = packer.getResult();
  Converter unpacker = new Converter(msgpack, r);
  if (unpacker.trySkipNil()) {
      assertEquals(null, v);
      return;
  }
        Value ret = unpacker.readValue();
        assertEquals(r, ret);
    }
View Full Code Here

    public void testBoolean(boolean v) throws Exception {
  MessagePack msgpack = new MessagePack();
        Unconverter packer = new Unconverter(msgpack);
        packer.writeBoolean(v);
        Value r = packer.getResult();
        Converter unpacker = new Converter(msgpack, r);
        boolean ret = unpacker.readBoolean();
        assertEquals(v, ret);
    }
View Full Code Here

    public void testByte(byte v) throws Exception {
  MessagePack msgpack = new MessagePack();
        Unconverter packer = new Unconverter(msgpack);
        packer.writeByte(v);
        Value r = packer.getResult();
        Converter unpacker = new Converter(msgpack, r);
        byte ret = unpacker.readByte();
        assertEquals(v, ret);
    }
View Full Code Here

    public void testShort(short v) throws Exception {
  MessagePack msgpack = new MessagePack();
        Unconverter packer = new Unconverter(msgpack);
        packer.writeShort(v);
        Value r = packer.getResult();
        Converter unpacker = new Converter(msgpack, r);
        short ret = unpacker.readShort();
        assertEquals(v, ret);
    }
View Full Code Here

TOP

Related Classes of org.msgpack.unpacker.Converter

Copyright © 2018 www.massapicom. 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.