Package org.msgpack.packer

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


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


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

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

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

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