Class ByteBufSchema

java.lang.Object
org.apache.pulsar.client.impl.schema.AbstractSchema<io.netty.buffer.ByteBuf>
org.apache.pulsar.client.impl.schema.ByteBufSchema
All Implemented Interfaces:
Cloneable, Schema<io.netty.buffer.ByteBuf>

public class ByteBufSchema extends AbstractSchema<io.netty.buffer.ByteBuf>
A variant `Bytes` schema that takes ByteBuf.
  • Constructor Details

    • ByteBufSchema

      public ByteBufSchema()
  • Method Details

    • of

      public static ByteBufSchema of()
    • encode

      public byte[] encode(io.netty.buffer.ByteBuf message)
    • decode

      public io.netty.buffer.ByteBuf decode(byte[] bytes)
    • decode

      public io.netty.buffer.ByteBuf decode(io.netty.buffer.ByteBuf byteBuf)
      Description copied from class: AbstractSchema
      Decode a byteBuf into an object using the schema definition and deserializer implementation

      Do not modify reader/writer index of ByteBuf so, it can be reused to access correct data.

      Specified by:
      decode in class AbstractSchema<io.netty.buffer.ByteBuf>
      Parameters:
      byteBuf - the byte buffer to decode
      Returns:
      the deserialized object
    • getSchemaInfo

      public SchemaInfo getSchemaInfo()