public class DataHeaderFlyweight extends HeaderFlyweight
Data Frame wiki page.
| Modifier and Type | Field and Description |
|---|---|
static short |
BEGIN_AND_END_FLAGS
Begin and End Flags.
|
static short |
BEGIN_END_AND_EOS_FLAGS
Begin, End, and EOS Flags.
|
static short |
BEGIN_FLAG
(B) - Fragment that Begins a message Flag.
|
static int |
DATA_OFFSET
Offset in the frame at which the data payload begins.
|
static long |
DEFAULT_RESERVE_VALUE
Default value to be placed in the reserved value field.
|
static short |
END_FLAG
(E) - Fragment that Ends a message Flag.
|
static short |
EOS_FLAG
(S) - End of Stream (EOS) Flag for heartbeats after the publication is closed.
|
static int |
HEADER_LENGTH
Length of the Data Header.
|
static int |
RESERVED_VALUE_OFFSET
Offset in the frame at which the reserved value field begins.
|
static int |
SESSION_ID_FIELD_OFFSET
Offset in the frame at which the session-id field begins.
|
static int |
STREAM_ID_FIELD_OFFSET
Offset in the frame at which the stream-id field begins.
|
static int |
TERM_ID_FIELD_OFFSET
Offset in the frame at which the term-id field begins.
|
static int |
TERM_OFFSET_FIELD_OFFSET
Offset in the frame at which the term-offset field begins.
|
CURRENT_VERSION, FLAGS_FIELD_OFFSET, FRAME_LENGTH_FIELD_OFFSET, HDR_TYPE_DATA, HDR_TYPE_ERR, HDR_TYPE_EXT, HDR_TYPE_NAK, HDR_TYPE_PAD, HDR_TYPE_RES, HDR_TYPE_RTTM, HDR_TYPE_SETUP, HDR_TYPE_SM, MIN_HEADER_LENGTH, TYPE_FIELD_OFFSET, VERSION_FIELD_OFFSETALIGNMENT, DISABLE_BOUNDS_CHECKS_PROP_NAME, SHOULD_BOUNDS_CHECKaddressOffset, byteArray, capacitySTRICT_ALIGNMENT_CHECKS, STRICT_ALIGNMENT_CHECKS_PROP_NAMEDISABLE_ARRAY_CONTENT_PRINTOUT_PROP_NAME, STR_HEADER_LEN| Constructor and Description |
|---|
DataHeaderFlyweight()
Default constructor which can later be used to wrap a frame.
|
DataHeaderFlyweight(ByteBuffer buffer)
Construct the flyweight over a frame.
|
DataHeaderFlyweight(UnsafeBuffer buffer)
Construct the flyweight over a frame.
|
| Modifier and Type | Method and Description |
|---|---|
static UnsafeBuffer |
createDefaultHeader(int sessionId,
int streamId,
int termId)
Return an initialised default Data Frame Header.
|
int |
dataOffset()
Return offset in buffer for data
|
static int |
fragmentLength(UnsafeBuffer termBuffer,
int frameOffset)
Get the fragment length field from the header.
|
static boolean |
isEndOfStream(UnsafeBuffer packet)
Does the data frame in the packet have the EOS flag set?
|
static boolean |
isHeartbeat(UnsafeBuffer packet,
int length)
Is the frame at data frame at the beginning of packet a heartbeat message?
|
long |
reservedValue()
Get the reserved value in LITTLE_ENDIAN format.
|
DataHeaderFlyweight |
reservedValue(long reservedValue)
Set the reserved value in LITTLE_ENDIAN format.
|
static long |
reservedValue(UnsafeBuffer termBuffer,
int frameOffset)
Get the reserved value field from the header.
|
int |
sessionId()
Get the session-id field from the header.
|
DataHeaderFlyweight |
sessionId(int sessionId)
Set the session-id field in the header.
|
static int |
sessionId(UnsafeBuffer termBuffer,
int frameOffset)
Get the session-id field from the header.
|
int |
streamId()
Get the stream-id field from the header.
|
DataHeaderFlyweight |
streamId(int streamId)
Set the stream-id field in the header.
|
static int |
streamId(UnsafeBuffer termBuffer,
int frameOffset)
Get the stream-id field from the header.
|
int |
termId()
Get the term-id field from the header.
|
DataHeaderFlyweight |
termId(int termId)
Set the term-id field in the header.
|
static int |
termId(UnsafeBuffer termBuffer,
int frameOffset)
Get the term-id field from the header.
|
int |
termOffset()
Get the term-offset field from the header.
|
DataHeaderFlyweight |
termOffset(int termOffset)
Set the term-offset field in the header.
|
static int |
termOffset(UnsafeBuffer termBuffer,
int frameOffset)
Get the term-offset field from the header.
|
String |
toString() |
appendFlagsAsChars, flags, flags, flagsToChars, frameLength, frameLength, headerType, headerType, version, versionaddIntOrdered, addLongOrdered, byteBuffer, compareAndSetInt, compareAndSetLong, ensureCapacity, getAndAddInt, getAndAddLong, getAndSetInt, getAndSetLong, getByteVolatile, getCharVolatile, getIntVolatile, getLongVolatile, getShortVolatile, isExpandable, putByteVolatile, putCharVolatile, putIntOrdered, putIntVolatile, putLongOrdered, putLongVolatile, putShortVolatile, verifyAlignment, wrap, wrap, wrap, wrap, wrap, wrap, wrap, wrapAdjustmentaddressOffset, boundsCheck, boundsCheck0, byteArray, capacity, checkLimit, compareTo, equals, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringUtf8, getStringUtf8, getStringUtf8, getStringWithoutLengthAscii, getStringWithoutLengthAscii, getStringWithoutLengthUtf8, hashCode, parseIntAscii, parseLongAscii, parseNaturalIntAscii, parseNaturalLongAscii, putByte, putBytes, putBytes, putBytes, putBytes, putBytes, putChar, putChar, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putIntAscii, putLong, putLong, putLongAscii, putNaturalIntAscii, putNaturalIntAsciiFromEnd, putNaturalLongAscii, putNaturalPaddedIntAscii, putShort, putShort, putStringAscii, putStringAscii, putStringAscii, putStringAscii, putStringUtf8, putStringUtf8, putStringUtf8, putStringUtf8, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthUtf8, setMemoryclone, finalize, getClass, notify, notifyAll, wait, wait, waitputByte, putBytes, putBytes, putBytes, putBytes, putBytes, putChar, putChar, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putIntAscii, putLong, putLong, putLongAscii, putNaturalIntAscii, putNaturalIntAsciiFromEnd, putNaturalLongAscii, putNaturalPaddedIntAscii, putShort, putShort, putStringAscii, putStringAscii, putStringAscii, putStringAscii, putStringUtf8, putStringUtf8, putStringUtf8, putStringUtf8, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthUtf8, setMemoryaddressOffset, boundsCheck, byteArray, capacity, checkLimit, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringUtf8, getStringUtf8, getStringUtf8, getStringWithoutLengthAscii, getStringWithoutLengthAscii, getStringWithoutLengthUtf8, parseIntAscii, parseLongAscii, parseNaturalIntAscii, parseNaturalLongAsciicompareTopublic static final int HEADER_LENGTH
public static final short BEGIN_FLAG
public static final short END_FLAG
public static final short BEGIN_AND_END_FLAGS
public static final short EOS_FLAG
public static final short BEGIN_END_AND_EOS_FLAGS
public static final long DEFAULT_RESERVE_VALUE
public static final int TERM_OFFSET_FIELD_OFFSET
public static final int SESSION_ID_FIELD_OFFSET
public static final int STREAM_ID_FIELD_OFFSET
public static final int TERM_ID_FIELD_OFFSET
public static final int RESERVED_VALUE_OFFSET
public static final int DATA_OFFSET
public DataHeaderFlyweight()
public DataHeaderFlyweight(UnsafeBuffer buffer)
buffer - containing the frame.public DataHeaderFlyweight(ByteBuffer buffer)
buffer - containing the frame.public static int fragmentLength(UnsafeBuffer termBuffer, int frameOffset)
termBuffer - containing the header.frameOffset - in the buffer where the header starts.public static boolean isHeartbeat(UnsafeBuffer packet, int length)
packet - containing the data frame.length - of the data frame.public static boolean isEndOfStream(UnsafeBuffer packet)
packet - containing the data frame.public int sessionId()
public static int sessionId(UnsafeBuffer termBuffer, int frameOffset)
termBuffer - containing the header.frameOffset - in the buffer where the header starts.public DataHeaderFlyweight sessionId(int sessionId)
sessionId - value to set.public int streamId()
public static int streamId(UnsafeBuffer termBuffer, int frameOffset)
termBuffer - containing the header.frameOffset - in the buffer where the header starts.public DataHeaderFlyweight streamId(int streamId)
streamId - value to set.public int termId()
public static int termId(UnsafeBuffer termBuffer, int frameOffset)
termBuffer - containing the header.frameOffset - in the buffer where the header starts.public DataHeaderFlyweight termId(int termId)
termId - value to set.public int termOffset()
public static int termOffset(UnsafeBuffer termBuffer, int frameOffset)
termBuffer - containing the header.frameOffset - in the buffer where the header starts.public DataHeaderFlyweight termOffset(int termOffset)
termOffset - value to set.public long reservedValue()
public static long reservedValue(UnsafeBuffer termBuffer, int frameOffset)
termBuffer - containing the header.frameOffset - in the buffer where the header starts.public DataHeaderFlyweight reservedValue(long reservedValue)
reservedValue - to be storedpublic int dataOffset()
public static UnsafeBuffer createDefaultHeader(int sessionId, int streamId, int termId)
sessionId - for the headerstreamId - for the headertermId - for the headerpublic String toString()
toString in class UnsafeBufferCopyright © 2014-2023 Real Logic Limited. All Rights Reserved.