public class HeaderWriter
extends java.lang.Object
This class is designed to be thread safe to be used across multiple producers and makes the header visible in the correct order for consumers.
Modifier and Type | Field and Description |
---|---|
protected long |
sessionId |
protected long |
streamId |
protected long |
versionFlagsType |
Modifier | Constructor and Description |
---|---|
protected |
HeaderWriter(long versionFlagsType,
long sessionId,
long streamId) |
Modifier and Type | Method and Description |
---|---|
static HeaderWriter |
newInstance(org.agrona.concurrent.UnsafeBuffer defaultHeader) |
void |
write(org.agrona.concurrent.UnsafeBuffer termBuffer,
int offset,
int length,
int termId)
Write a header to the term buffer in
ByteOrder.LITTLE_ENDIAN format using the minimum instructions. |
protected final long versionFlagsType
protected final long sessionId
protected final long streamId
protected HeaderWriter(long versionFlagsType, long sessionId, long streamId)
public static HeaderWriter newInstance(org.agrona.concurrent.UnsafeBuffer defaultHeader)
public void write(org.agrona.concurrent.UnsafeBuffer termBuffer, int offset, int length, int termId)
ByteOrder.LITTLE_ENDIAN
format using the minimum instructions.termBuffer
- to be written to.offset
- at which the header should be written.length
- of the fragment including the header.termId
- of the current term buffer.Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.