Examples of writeFloat()


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.createUnpacker(new ByteArrayInputStream(bytes));
  float ret = unpacker.readFloat();
  assertEquals(v, ret, 10e-10);
    }
View Full Code Here

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

    @Override
    public void testFloat(float v) throws Exception {
  MessagePack msgpack = new MessagePack();
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
  packer.writeFloat(v);
  ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
  Unpacker unpacker = msgpack.createUnpacker(in);
  float ret = unpacker.readFloat();
  assertEquals(v, ret, 10e-10);
    }
View Full Code Here

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

    @Override
    public void testFloat(float v) throws Exception {
  MessagePack msgpack = new MessagePack();
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
  packer.writeFloat(v);
  byte[] bytes = out.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()

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

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

    @Override
    public void testFloat(float v) throws Exception {
  MessagePack msgpack = new MessagePack();
        Unconverter packer = new Unconverter(msgpack);
        packer.writeFloat(v);
        Value r = packer.getResult();
        Converter unpacker = new Converter(msgpack, r);
        Value ret = unpacker.readValue();
  assertEquals(r, ret);
    }
View Full Code Here

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

    @Override
    public void testFloat(float v) throws Exception {
  MessagePack msgpack = new MessagePack();
        Unconverter packer = new Unconverter(msgpack);
        packer.writeFloat(v);
        Value r = packer.getResult();
        Converter unpacker = new Converter(msgpack, r);
        float ret = unpacker.readFloat();
  assertEquals(v, ret, 10e-10);
    }
View Full Code Here

Examples of parquet.column.values.plain.PlainValuesWriter.writeFloat()

        // return a dictionary only if we actually used it
        PlainValuesWriter dictionaryEncoder = new PlainValuesWriter(lastUsedDictionaryByteSize);
        FloatIterator floatIterator = floatDictionaryContent.keySet().iterator();
        // write only the part of the dict that we used
        for (int i = 0; i < lastUsedDictionarySize; i++) {
          dictionaryEncoder.writeFloat(floatIterator.nextFloat());
        }
        return new DictionaryPage(dictionaryEncoder.getBytes(), lastUsedDictionarySize, PLAIN_DICTIONARY);
      }
      return plainValuesWriter.createDictionaryPage();
    }
View Full Code Here

Examples of ucar.unidata.io.RandomAccessFile.writeFloat()

    // Min/Max values
    for (vr=0; vr<NumVars; vr++) {
      if (!write_tag(TAG_MINVAL, 8, newfile)) return false;
      f.writeInt(vr);
      f.writeFloat(MinVal[vr]);
      if (!write_tag(TAG_MAXVAL, 8, newfile)) return false;
      f.writeInt(vr);
      f.writeFloat(MaxVal[vr]);
    }
View Full Code Here

Examples of ucar.unidata.io.RandomAccessFile.writeFloat()

      if (!write_tag(TAG_MINVAL, 8, newfile)) return false;
      f.writeInt(vr);
      f.writeFloat(MinVal[vr]);
      if (!write_tag(TAG_MAXVAL, 8, newfile)) return false;
      f.writeInt(vr);
      f.writeFloat(MaxVal[vr]);
    }

    // Compress mode
    if (!write_tag(TAG_COMPRESS, 4, newfile)) return false;
    f.writeInt(CompressMode);
View Full Code Here

Examples of ucar.unidata.io.RandomAccessFile.writeFloat()

    // Vertical Coordinate System
    if (!write_tag(TAG_VERTICAL_SYSTEM, 4, newfile)) return false;
    f.writeInt(VerticalSystem);
    if (!write_tag(TAG_VERT_ARGS, 4+4*MAXVERTARGS, newfile)) return false;
    f.writeInt(MAXVERTARGS);
    for (int q=0; q<MAXVERTARGS; q++) f.writeFloat(VertArgs[q]);

    // Map Projection
    if (!write_tag(TAG_PROJECTION, 4, newfile)) return false;
    f.writeInt(Projection);
    if (!write_tag(TAG_PROJ_ARGS, 4+4*MAXPROJARGS, newfile)) return false;
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.