Package org.apache.avro.io

Examples of org.apache.avro.io.Decoder.readFloat()


    Encoder encoder = new ColumnEncoder(byteOutputStream);
    encoder.writeFloat(1.1f);
    encoder.flush();
    InputStream in = new ByteArrayInputStream(byteOutputStream.toByteArray());
    Decoder decoder = new ColumnDecoder(in);
    float readFloat = decoder.readFloat();
    assertEquals(1.1f, readFloat, 0.0001);

    byteOutputStream = new ByteArrayOutputStream();
    encoder = new ColumnEncoder(byteOutputStream);
    encoder.writeDouble(1.1d);
View Full Code Here


    ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
    Encoder encoder = new MemcmpEncoder(byteOutputStream);
    encoder.writeFloat(1.1f);
    InputStream in = new ByteArrayInputStream(byteOutputStream.toByteArray());
    Decoder decoder = new MemcmpDecoder(in);
    float readFloat = decoder.readFloat();
    assertEquals(1.1f, readFloat, 0.0001);

    byteOutputStream = new ByteArrayOutputStream();
    encoder = new MemcmpEncoder(byteOutputStream);
    encoder.writeDouble(1.1d);
View Full Code Here

    ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
    Encoder encoder = new MemcmpEncoder(byteOutputStream);
    encoder.writeFloat(1.1f);
    InputStream in = new ByteArrayInputStream(byteOutputStream.toByteArray());
    Decoder decoder = new MemcmpDecoder(in);
    float readFloat = decoder.readFloat();
    assertEquals(1.1f, readFloat, 0.0001);

    byteOutputStream = new ByteArrayOutputStream();
    encoder = new MemcmpEncoder(byteOutputStream);
    encoder.writeDouble(1.1d);
View Full Code Here

    Encoder encoder = new ColumnEncoder(byteOutputStream);
    encoder.writeFloat(1.1f);
    encoder.flush();
    InputStream in = new ByteArrayInputStream(byteOutputStream.toByteArray());
    Decoder decoder = new ColumnDecoder(in);
    float readFloat = decoder.readFloat();
    assertEquals(1.1f, readFloat, 0.0001);

    byteOutputStream = new ByteArrayOutputStream();
    encoder = new ColumnEncoder(byteOutputStream);
    encoder.writeDouble(1.1d);
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.