Class BytesSchema

java.lang.Object
org.apache.pulsar.client.impl.schema.AbstractSchema<byte[]>
org.apache.pulsar.client.impl.schema.BytesSchema
All Implemented Interfaces:
Cloneable, Schema<byte[]>

public class BytesSchema extends AbstractSchema<byte[]>
A schema for bytes array.
  • Constructor Details

    • BytesSchema

      public BytesSchema()
  • Method Details

    • of

      public static BytesSchema of()
    • encode

      public byte[] encode(byte[] message)
    • decode

      public byte[] decode(byte[] bytes)
    • decode

      public byte[] 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<byte[]>
      Parameters:
      byteBuf - the byte buffer to decode
      Returns:
      the deserialized object
    • getSchemaInfo

      public SchemaInfo getSchemaInfo()