Package io.aeron.logbuffer
Class HeaderWriter
java.lang.Object
io.aeron.logbuffer.HeaderWriter
Utility for applying a header to a message in a term buffer.
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.
-
Method Summary
Modifier and TypeMethodDescriptionstatic HeaderWriternewInstance(UnsafeBuffer defaultHeader) Create a newHeaderWriterthat isByteOrderspecific to the platform.voidwrite(UnsafeBuffer termBuffer, int offset, int length, int termId) Write a header to the term buffer inByteOrder.LITTLE_ENDIANformat using the minimum instructions.
-
Method Details
-
newInstance
Create a newHeaderWriterthat isByteOrderspecific to the platform.- Parameters:
defaultHeader- for the stream.- Returns:
- a new
HeaderWriterthat isByteOrderspecific to the platform.
-
write
Write a header to the term buffer inByteOrder.LITTLE_ENDIANformat using the minimum instructions.- Parameters:
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.
-