Package org.apache.avro.io

Examples of org.apache.avro.io.Encoder.writeFloat()


  @Test
  public void testReadEncoderOutput() throws Exception {
    ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
    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);
View Full Code Here


  @Test
  public void testReadEncoderOutput() throws Exception {
    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);
View Full Code Here

  @Test
  public void testReadEncoderOutput() throws Exception {
    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);
View Full Code Here

  @Test
  public void testReadEncoderOutput() throws Exception {
    ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
    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);
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.