public final class RecordDescriptor extends Object
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |R| Length | +-+-------------------------------------------------------------+ | Type | +---------------------------------------------------------------+ | Encoded Message ... ... | +---------------------------------------------------------------+
(R) bits are reserved.
Modifier and Type | Field and Description |
---|---|
static int |
HEADER_LENGTH
Length of the record header in bytes.
|
static int |
LENGTH_OFFSET
Offset within the record at which the record length field begins.
|
static int |
PADDING_MSG_TYPE_ID
Message type is padding to prevent fragmentation in the buffer.
|
static int |
RECORD_ALIGNMENT
Alignment as a multiple of bytes for each record.
|
static int |
TYPE_OFFSET
Offset within the record at which the message type field begins.
|
Modifier and Type | Method and Description |
---|---|
static int |
calculateMaxMessageLength(int capacity)
Calculate the maximum supported message length for a buffer of given capacity.
|
static void |
checkTypeId(int msgTypeId)
Check that and message id is in the valid range.
|
static int |
lengthOffset(int recordOffset)
The buffer offset at which the message length field begins.
|
static int |
msgOffset(int recordOffset)
The buffer offset at which the encoded message begins.
|
static int |
typeOffset(int recordOffset)
The buffer offset at which the message type field begins.
|
public static final int PADDING_MSG_TYPE_ID
public static final int LENGTH_OFFSET
public static final int TYPE_OFFSET
public static final int HEADER_LENGTH
public static final int RECORD_ALIGNMENT
public static int calculateMaxMessageLength(int capacity)
capacity
- of the log buffer.public static int lengthOffset(int recordOffset)
recordOffset
- at which the frame begins.public static int typeOffset(int recordOffset)
recordOffset
- at which the frame begins.public static int msgOffset(int recordOffset)
recordOffset
- at which the frame begins.public static void checkTypeId(int msgTypeId)
msgTypeId
- to be checked.IllegalArgumentException
- if the id is not in the valid range.Copyright © 2014-2021 Real Logic Limited. All Rights Reserved.