Class BytesSchema
- java.lang.Object
-
- org.apache.pulsar.client.impl.schema.AbstractSchema<byte[]>
-
- org.apache.pulsar.client.impl.schema.BytesSchema
-
- All Implemented Interfaces:
java.lang.Cloneable,org.apache.pulsar.client.api.Schema<byte[]>
public class BytesSchema extends AbstractSchema<byte[]>
A schema for bytes array.
-
-
Constructor Summary
Constructors Constructor Description BytesSchema()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decode(byte[] bytes)byte[]decode(io.netty.buffer.ByteBuf byteBuf)Decode a byteBuf into an object using the schema definition and deserializer implementationbyte[]encode(byte[] message)org.apache.pulsar.common.schema.SchemaInfogetSchemaInfo()static BytesSchemaof()-
Methods inherited from class org.apache.pulsar.client.impl.schema.AbstractSchema
atSchemaVersion, clone, decode
-
-
-
-
Method Detail
-
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:AbstractSchemaDecode a byteBuf into an object using the schema definition and deserializer implementationDo not modify reader/writer index of ByteBuf so, it can be reused to access correct data.
- Specified by:
decodein classAbstractSchema<byte[]>- Parameters:
byteBuf- the byte buffer to decode- Returns:
- the deserialized object
-
getSchemaInfo
public org.apache.pulsar.common.schema.SchemaInfo getSchemaInfo()
-
-