Java Code Examples for org.agrona.concurrent.UnsafeBuffer#getByte()

The following examples show how to use org.agrona.concurrent.UnsafeBuffer#getByte() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Catalog.java    From aeron with Apache License 2.0 4 votes vote down vote up
static boolean isValidDescriptor(final UnsafeBuffer descriptorBuffer)
{
    return descriptorBuffer.getByte(RecordingDescriptorHeaderDecoder.validEncodingOffset()) == VALID;
}
 
Example 2
Source File: DataHeaderFlyweight.java    From aeron with Apache License 2.0 2 votes vote down vote up
/**
 * Does the data frame in the packet have the EOS flag set?
 *
 * @param packet containing the data frame.
 * @return true if the EOS flag is set otherwise false.
 */
public static boolean isEndOfStream(final UnsafeBuffer packet)
{
    return BEGIN_END_AND_EOS_FLAGS == (packet.getByte(FLAGS_FIELD_OFFSET) & 0xFF);
}
 
Example 3
Source File: FrameDescriptor.java    From aeron with Apache License 2.0 2 votes vote down vote up
/**
 * Read the type of of the frame from header.
 *
 * @param buffer     containing the frame.
 * @param termOffset at which a frame begins.
 * @return the value of the frame type header.
 */
public static int frameVersion(final UnsafeBuffer buffer, final int termOffset)
{
    return buffer.getByte(versionOffset(termOffset));
}
 
Example 4
Source File: FrameDescriptor.java    From aeron with Apache License 2.0 2 votes vote down vote up
/**
 * Get the flags field for a frame.
 *
 * @param buffer     containing the frame.
 * @param termOffset at which a frame begins.
 * @return the value of the flags.
 */
public static byte frameFlags(final UnsafeBuffer buffer, final int termOffset)
{
    return buffer.getByte(flagsOffset(termOffset));
}