Class GenericAvroReader

  • All Implemented Interfaces:
    org.apache.pulsar.client.api.schema.SchemaReader<org.apache.pulsar.client.api.schema.GenericRecord>

    public class GenericAvroReader
    extends java.lang.Object
    implements org.apache.pulsar.client.api.schema.SchemaReader<org.apache.pulsar.client.api.schema.GenericRecord>
    • Constructor Summary

      Constructors 
      Constructor Description
      GenericAvroReader​(org.apache.avro.Schema schema)  
      GenericAvroReader​(org.apache.avro.Schema writerSchema, org.apache.avro.Schema readerSchema, byte[] schemaVersion)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.Object> getNativeSchema()  
      int getOffset()  
      GenericAvroRecord read​(byte[] bytes, int offset, int length)  
      org.apache.pulsar.client.api.schema.GenericRecord read​(java.io.InputStream inputStream)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.pulsar.client.api.schema.SchemaReader

        read, read, read, setSchemaInfoProvider
    • Constructor Detail

      • GenericAvroReader

        public GenericAvroReader​(org.apache.avro.Schema schema)
      • GenericAvroReader

        public GenericAvroReader​(org.apache.avro.Schema writerSchema,
                                 org.apache.avro.Schema readerSchema,
                                 byte[] schemaVersion)
    • Method Detail

      • read

        public GenericAvroRecord read​(byte[] bytes,
                                      int offset,
                                      int length)
        Specified by:
        read in interface org.apache.pulsar.client.api.schema.SchemaReader<org.apache.pulsar.client.api.schema.GenericRecord>
      • read

        public org.apache.pulsar.client.api.schema.GenericRecord read​(java.io.InputStream inputStream)
        Specified by:
        read in interface org.apache.pulsar.client.api.schema.SchemaReader<org.apache.pulsar.client.api.schema.GenericRecord>
      • getOffset

        public int getOffset()
      • getNativeSchema

        public java.util.Optional<java.lang.Object> getNativeSchema()
        Specified by:
        getNativeSchema in interface org.apache.pulsar.client.api.schema.SchemaReader<org.apache.pulsar.client.api.schema.GenericRecord>