Package org.msgpack.unpacker

Examples of org.msgpack.unpacker.BufferUnpacker.readFloat()


  MessagePack msgpack = new MessagePack();
  BufferPacker packer = msgpack.createBufferPacker();
  packer.writeFloat(v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
  float ret = unpacker.readFloat();
  assertEquals(v, ret, 10e-10);
    }

    @Test @Override
    public void testDouble() throws Exception {
View Full Code Here


  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
  packer.writeFloat(v);
  byte[] bytes = out.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
  float ret = unpacker.readFloat();
  assertEquals(v, ret, 10e-10);
    }

    @Test @Override
    public void testDouble() throws Exception {
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.