Package uk.co.real_logic.sbe.otf
Class OtfHeaderDecoder
java.lang.Object
uk.co.real_logic.sbe.otf.OtfHeaderDecoder
Used to decode a message header while doing on-the-fly decoding of a message stream.
Metadata is cached to improve the performance of decoding headers.
This class is thread safe.
-
Constructor Summary
ConstructorsConstructorDescriptionOtfHeaderDecoder(HeaderStructure headerStructure) Read the message header structure and cache the meta data for finding the key fields for decoding messages. -
Method Summary
Modifier and TypeMethodDescriptionintThe encodedLength of the message header in bytes.intgetBlockLength(DirectBuffer buffer, int bufferOffset) Get the block length of the root block in the message.intgetSchemaId(DirectBuffer buffer, int bufferOffset) Get the schema id number from the message header.intgetSchemaVersion(DirectBuffer buffer, int bufferOffset) Get the schema version number from the message header.intgetTemplateId(DirectBuffer buffer, int bufferOffset) Get the template id from the message header.
-
Constructor Details
-
OtfHeaderDecoder
Read the message header structure and cache the meta data for finding the key fields for decoding messages.- Parameters:
headerStructure- for the meta data describing the message header.
-
-
Method Details
-
encodedLength
public int encodedLength()The encodedLength of the message header in bytes.- Returns:
- the encodedLength of the message header in bytes.
-
getBlockLength
Get the block length of the root block in the message.- Parameters:
buffer- from which to read the value.bufferOffset- in the buffer at which the message header begins.- Returns:
- the length of the root block in the coming message.
-
getTemplateId
Get the template id from the message header.- Parameters:
buffer- from which to read the value.bufferOffset- in the buffer at which the message header begins.- Returns:
- the value of the template id.
-
getSchemaId
Get the schema id number from the message header.- Parameters:
buffer- from which to read the value.bufferOffset- in the buffer at which the message header begins.- Returns:
- the value of the schema id number.
-
getSchemaVersion
Get the schema version number from the message header.- Parameters:
buffer- from which to read the value.bufferOffset- in the buffer at which the message header begins.- Returns:
- the value of the schema version number.
-