public class OtfMessageDecoder
extends java.lang.Object
The contents of the messages are structurally decomposed and passed to a TokenListener
for decoding the
primitive values.
The design keeps all state on the stack to maximise performance and avoid object allocation. The message decoder can
be reused repeatably by calling decode(DirectBuffer, int, int, int, List, TokenListener)
which is thread safe to be used across multiple threads.
Constructor and Description |
---|
OtfMessageDecoder() |
Modifier and Type | Method and Description |
---|---|
static int |
decode(org.agrona.DirectBuffer buffer,
int offset,
int actingVersion,
int blockLength,
java.util.List<Token> msgTokens,
TokenListener listener)
Decode a message from the provided buffer based on the message schema described with IR
Token s. |
public static int decode(org.agrona.DirectBuffer buffer, int offset, int actingVersion, int blockLength, java.util.List<Token> msgTokens, TokenListener listener)
Token
s.buffer
- containing the encoded message.offset
- at which the message encoding starts in the buffer.actingVersion
- of the encoded message for dealing with extension fields.blockLength
- of the root message fields.msgTokens
- in IR format describing the message structure.listener
- to callback for decoding the primitive values as discovered in the structure.Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.