Package org.apache.avro.io

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


    double readDouble = decoder.readDouble();
    assertEquals(1.1d, readDouble, 0.0001);

    byteOutputStream = new ByteArrayOutputStream();
    encoder = new MemcmpEncoder(byteOutputStream);
    encoder.writeString("hello there");
    in = new ByteArrayInputStream(byteOutputStream.toByteArray());
    decoder = new MemcmpDecoder(in);
    Utf8 readString = decoder.readString(null);
    assertEquals("hello there", readString.toString());
  }
View Full Code Here


    double readDouble = decoder.readDouble();
    assertEquals(1.1d, readDouble, 0.0001);

    byteOutputStream = new ByteArrayOutputStream();
    encoder = new MemcmpEncoder(byteOutputStream);
    encoder.writeString("hello there");
    in = new ByteArrayInputStream(byteOutputStream.toByteArray());
    decoder = new MemcmpDecoder(in);
    Utf8 readString = decoder.readString(null);
    assertEquals("hello there", readString.toString());
  }
View Full Code Here

    double readDouble = decoder.readDouble();
    assertEquals(1.1d, readDouble, 0.0001);

    byteOutputStream = new ByteArrayOutputStream();
    encoder = new ColumnEncoder(byteOutputStream);
    encoder.writeString("hello there");
    encoder.flush();
    in = new ByteArrayInputStream(byteOutputStream.toByteArray());
    decoder = new ColumnDecoder(in);
    Utf8 readString = decoder.readString(null);
    assertEquals("hello there", readString.toString());
View Full Code Here

      m = getLocal().getMessages().get(messageName);
      if (m == null)
        throw new AvroRuntimeException("Not a local message: "+messageName);
     
      META_WRITER.write(requestMeta, out);
      out.writeString(m.getName());       // write message name
      writeRequest(m.getRequest(), request, out); // write request payload
     
      List<ByteBuffer> response =                 // transceive
        getTransceiver().transceive(bbo.getBufferList());
     
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.