public abstract class ByteDecoder extends Object
| Constructor and Description |
|---|
ByteDecoder() |
| Modifier and Type | Method and Description |
|---|---|
abstract Object |
createEmptyComposite(String sbeCompositeTypeName,
Object ref)
Creates (or fills) an object for a custom composite type by SBE type name.
|
abstract <T> T |
createEmptyCustomComposite(Class<T> cls)
Creates an empty instance that implements a custom composite interface.
|
abstract IMessage |
decode(byte[] data,
int offset,
int size)
Decodes message bytes and returns a message object bound to the provided buffer.
|
abstract IMessage |
decodePreCreatedMessage(byte[] data,
int offset,
int size)
Decodes message bytes using reusable pre-created message instances.
|
abstract IMessage |
encode(byte[] data,
int offset,
int size,
int templateId)
Initializes a message for encoding in the provided buffer.
|
abstract IMessage |
encodePreCreatedMessage(byte[] data,
int offset,
int size,
int templateId)
Initializes a pre-created reusable message instance for encoding.
|
abstract boolean |
isNullComposite(String sbeCompositeTypeName,
Object ref)
Checks whether a custom composite value is null for the specified SBE type.
|
public abstract IMessage decode(byte[] data, int offset, int size)
The implementation reads framing header and message header, resolves template, binds the result object to the input bytes, and returns it.
data - byte buffer with SBE packet data.offset - start offset of packet in buffer.size - number of available bytes starting from offset.null when there is not enough data.public abstract IMessage decodePreCreatedMessage(byte[] data, int offset, int size)
This method may return a reused object on subsequent calls. Do not keep returned instance across threads unless you clone it.
data - byte buffer with SBE packet data.offset - start offset of packet in buffer.size - number of available bytes starting from offset.null when there is not enough data.public abstract IMessage encode(byte[] data, int offset, int size, int templateId)
The implementation selects template by ID, initializes headers, and prepares repeating groups/var-data structures.
data - target buffer for message bytes.offset - start offset of message in buffer.size - number of available bytes starting from offset.templateId - message template ID.null when there is not enough space.public abstract IMessage encodePreCreatedMessage(byte[] data, int offset, int size, int templateId)
This method may return a reused object on subsequent calls. Do not keep returned instance across threads unless you clone it.
data - target buffer for message bytes.offset - start offset of message in buffer.size - number of available bytes starting from offset.templateId - message template ID.null when there is not enough space.public abstract <T> T createEmptyCustomComposite(Class<T> cls)
The interface class must be passed to
ByteDecoderFactory.create(MessageSchema, Class[]) when decoder is created.
T - custom composite type.cls - custom composite interface or class.public abstract Object createEmptyComposite(String sbeCompositeTypeName, Object ref)
If ref == null, implementation creates a new object.
If ref != null, implementation fills and returns the same object.
When ref != null, its Java type must match requested composite type.
sbeCompositeTypeName - composite type name as defined in SBE template.ref - optional object instance to fill.ref instance after filling.public abstract boolean isNullComposite(String sbeCompositeTypeName, Object ref)
sbeCompositeTypeName - SBE composite type name.ref - object to check.true if object contains null representation.Copyright © 2013–2026 Onix Solutions. All rights reserved.