Class ByteBufSchema
java.lang.Object
org.apache.pulsar.client.impl.schema.AbstractSchema<io.netty.buffer.ByteBuf>
org.apache.pulsar.client.impl.schema.ByteBufSchema
A variant `Bytes` schema that takes
ByteBuf.-
Field Summary
Fields inherited from interface org.apache.pulsar.client.api.Schema
BOOL, BYTEBUFFER, BYTES, DATE, DOUBLE, FLOAT, INSTANT, INT16, INT32, INT64, INT8, LOCAL_DATE, LOCAL_DATE_TIME, LOCAL_TIME, STRING, TIME, TIMESTAMP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.netty.buffer.ByteBufdecode(byte[] bytes) io.netty.buffer.ByteBufdecode(io.netty.buffer.ByteBuf byteBuf) Decode a byteBuf into an object using the schema definition and deserializer implementationbyte[]encode(io.netty.buffer.ByteBuf message) static ByteBufSchemaof()Methods inherited from class org.apache.pulsar.client.impl.schema.AbstractSchema
atSchemaVersion, clone, decodeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.client.api.Schema
configureSchemaInfo, decode, decode, decode, getNativeSchema, requireFetchingSchemaInfo, setSchemaInfoProvider, supportSchemaVersioning, validate
-
Constructor Details
-
ByteBufSchema
public ByteBufSchema()
-
-
Method Details
-
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: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<io.netty.buffer.ByteBuf>- Parameters:
byteBuf- the byte buffer to decode- Returns:
- the deserialized object
-
getSchemaInfo
-