Examples of writeFloat()


Examples of org.msgpack.packer.BufferPacker.writeFloat()

    public void testFloat(float v) throws Exception {
  MessagePack msgpack = new JSON();
  BufferPacker packer = msgpack.createBufferPacker();
        if(((Float)v).isInfinite() || ((Float)v).isNaN()) {
            try {
                packer.writeFloat(v);
                fail("JSONPacker should reject infinite and NaN value");
            } catch (IOException ex) {
                assertTrue(ex instanceof IOException);
            }
            return;
View Full Code Here

Examples of org.msgpack.packer.BufferPacker.writeFloat()

            } catch (IOException ex) {
                assertTrue(ex instanceof IOException);
            }
            return;
        }
  packer.writeFloat(v);
  byte[] bytes = packer.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  float ret = unpacker.readFloat();
  assertEquals(v, ret, 10e-10);
    }
View Full Code Here

Examples of org.msgpack.packer.BufferPacker.writeFloat()

    public void testFloat(float v) throws Exception {
  MessagePack msgpack = new JSON();
  BufferPacker packer = msgpack.createBufferPacker();
        if(((Float)v).isInfinite() || ((Float)v).isNaN()) {
            try {
                packer.writeFloat(v);
                fail("JSONPacker should reject infinite and NaN value");
            } catch (IOException ex) {
                assertTrue(ex instanceof IOException);
            }
            return;
View Full Code Here

Examples of org.msgpack.packer.BufferPacker.writeFloat()

            } catch (IOException ex) {
                assertTrue(ex instanceof IOException);
            }
            return;
        }
  packer.writeFloat(v);
  byte[] bytes = packer.toByteArray();
        Unpacker unpacker = msgpack.createBufferUnpacker(bytes);
  float ret = unpacker.readFloat();
  assertEquals(v, ret, 10e-10);
    }
View Full Code Here

Examples of org.msgpack.packer.BufferPacker.writeFloat()

    @Override
    public void testFloat(float v) throws Exception {
  MessagePack msgpack = new MessagePack();
  BufferPacker packer = msgpack.createBufferPacker();
  packer.writeFloat(v);
  byte[] bytes = packer.toByteArray();
  Unpacker unpacker = msgpack.createUnpacker(new ByteArrayInputStream(bytes));
  float ret = unpacker.readFloat();
  assertEquals(v, ret, 10e-10);
    }
View Full Code Here

Examples of org.msgpack.packer.BufferPacker.writeFloat()

    @Override
    public void testFloat(float v) throws Exception {
  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);
    }
View Full Code Here

Examples of org.msgpack.packer.BufferPacker.writeFloat()

    @Override
    public void testFloat(float v) throws Exception {
  MessagePack msgpack = new MessagePack();
  BufferPacker packer = msgpack.createBufferPacker();
  packer.writeFloat(v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
  Value value = unpacker.readValue();
  assertTrue(value.isFloat());
  float ret = new Converter(value).readFloat();
View Full Code Here

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

  MessagePack msgpack = new JSON();
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
        if(((Float)v).isInfinite() || ((Float)v).isNaN()) {
            try {
                packer.writeFloat(v);
                fail("JSONPacker should reject infinite and NaN value");
            } catch (IOException ex) {
                assertTrue(ex instanceof IOException);
            }
            return;
View Full Code Here

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

            } catch (IOException ex) {
                assertTrue(ex instanceof IOException);
            }
            return;
        }
  packer.writeFloat(v);
  byte[] bytes = out.toByteArray();
  Unpacker unpacker = msgpack.createBufferUnpacker(bytes);
  float ret = unpacker.readFloat();
  assertEquals(v, ret, 10e-10);
    }
View Full Code Here

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

  MessagePack msgpack = new JSON();
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
        if(((Float)v).isInfinite() || ((Float)v).isNaN()) {
            try {
                packer.writeFloat(v);
                fail("JSONPacker should reject infinite and NaN value");
            } catch (IOException ex) {
                assertTrue(ex instanceof IOException);
            }
            return;
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.