Interface SchemaReader<T>
Deserialize messages from bytes.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the underling Schema if possible.default T
read
(byte[] bytes) Serialize bytes convert pojo.default T
read
(byte[] bytes, byte[] schemaVersion) Serialize bytes convert pojo.read
(byte[] bytes, int offset, int length) serialize bytes convert pojo.read
(InputStream inputStream) serialize bytes convert pojo.default T
read
(InputStream inputStream, byte[] schemaVersion) serialize bytes convert pojo.default void
setSchemaInfoProvider
(SchemaInfoProvider schemaInfoProvider) Set schema info provider, this method support multi version reader.
-
Method Details
-
read
Serialize bytes convert pojo.- Parameters:
bytes
- the data- Returns:
- the serialized object
-
read
serialize bytes convert pojo.- Parameters:
bytes
- the dataoffset
- the byte[] initial positionlength
- the byte[] read length- Returns:
- the serialized object
-
read
serialize bytes convert pojo.- Parameters:
inputStream
- the stream of message- Returns:
- the serialized object
-
read
Serialize bytes convert pojo.- Parameters:
bytes
- the dataschemaVersion
- the schema version of message- Returns:
- the serialized object
-
read
serialize bytes convert pojo.- Parameters:
inputStream
- the stream of messageschemaVersion
- the schema version of message- Returns:
- the serialized object
-
setSchemaInfoProvider
Set schema info provider, this method support multi version reader.- Parameters:
schemaInfoProvider
- the stream of message
-
getNativeSchema
Returns the underling Schema if possible.- Returns:
- the schema, or an empty Optional if it is not possible to access it
-