public class RecordDescriptor
extends java.lang.Object
RingBuffer
.Modifier and Type | Field and Description |
---|---|
static int |
ALIGNMENT
Alignment as a multiple of bytes for each record.
|
static int |
HEADER_LENGTH
Header length made up of fields for length, type, and then the encoded message.
|
Constructor and Description |
---|
RecordDescriptor() |
Modifier and Type | Method and Description |
---|---|
static void |
checkTypeId(int msgTypeId)
Check that and message id is in the valid range.
|
static int |
encodedMsgOffset(int recordOffset)
The offset from the beginning of a record at which the encoded message begins.
|
static int |
lengthOffset(int recordOffset)
The offset from the beginning of a record at which the message length field begins.
|
static int |
typeOffset(int recordOffset)
The offset from the beginning of a record at which the message type field begins.
|
public static final int HEADER_LENGTH
Writing of a positive record length signals the message recording is complete.
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length | +---------------------------------------------------------------+ | Type | +---------------------------------------------------------------+ | Encoded Message ... ... | +---------------------------------------------------------------+
public static final int ALIGNMENT
public static int lengthOffset(int recordOffset)
recordOffset
- beginning index of the record.public static int typeOffset(int recordOffset)
recordOffset
- beginning index of the record.public static int encodedMsgOffset(int recordOffset)
recordOffset
- beginning index of the record.public static void checkTypeId(int msgTypeId)
msgTypeId
- to be checked.java.lang.IllegalArgumentException
- if the id is not in the valid range.Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.