| Constructor and Description |
|---|
ByteSchema() |
| Modifier and Type | Method and Description |
|---|---|
Byte |
decode(byte[] bytes) |
Byte |
decode(io.netty.buffer.ByteBuf byteBuf)
Decode a byteBuf into an object using the schema definition and deserializer implementation
|
byte[] |
encode(Byte message) |
SchemaInfo |
getSchemaInfo() |
static ByteSchema |
of() |
void |
validate(byte[] message) |
void |
validate(io.netty.buffer.ByteBuf message)
Check if the message read able length length is a valid object for this schema.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitAUTO_CONSUME, AUTO_PRODUCE_BYTES, AUTO_PRODUCE_BYTES, AUTO, AVRO, AVRO, configureSchemaInfo, decode, generic, getSchema, JSON, JSON, KeyValue, KeyValue, KeyValue, KeyValue, KV_BYTES, PROTOBUF, PROTOBUF, requireFetchingSchemaInfo, setSchemaInfoProvider, supportSchemaVersioningpublic static ByteSchema of()
public void validate(byte[] message)
public void validate(io.netty.buffer.ByteBuf message)
The implementation can choose what its most efficient approach to validate the schema.
If the implementation doesn't provide it, it will attempt to use decode(ByteBuf)
to see if this schema can decode this message or not as a validation mechanism to verify
the bytes.
message - the messages to verifypublic byte[] encode(Byte message)
public Byte decode(byte[] bytes)
public Byte decode(io.netty.buffer.ByteBuf byteBuf)
byteBuf - the byte buffer to decodepublic SchemaInfo getSchemaInfo()
Copyright © 2017–2020 Apache Software Foundation. All rights reserved.