public static int read(final AtomicBuffer buffer, final EntryConsumer entryConsumer)
    {
        final int capacity = buffer.capacity();

        int recordsRead = 0;
        int offset = 0;

        while (offset < capacity)
        {
            final long observationCount = buffer.getLongVolatile(offset + OBSERVATION_COUNT_OFFSET);
            if (observationCount <= 0)
            {
                break;
            }

            ++recordsRead;

            final String channel = buffer.getStringAscii(offset + CHANNEL_OFFSET);
            final String source = buffer.getStringAscii(offset + CHANNEL_OFFSET + SIZE_OF_INT + channel.length());

            entryConsumer.accept(
                observationCount,
                buffer.getLong(offset + TOTAL_BYTES_LOST_OFFSET),
                buffer.getLong(offset + FIRST_OBSERVATION_OFFSET),
                buffer.getLong(offset + LAST_OBSERVATION_OFFSET),
                buffer.getInt(offset + SESSION_ID_OFFSET),
                buffer.getInt(offset + STREAM_ID_OFFSET),
                channel,
                source);

            final int recordLength = CHANNEL_OFFSET + (SIZE_OF_INT * 2) + channel.length() + source.length();
            offset += BitUtil.align(recordLength, ENTRY_ALIGNMENT);
        }

        return recordsRead;
    }
public static int read(final AtomicBuffer buffer, final EntryConsumer entryConsumer)
    {
        final int capacity = buffer.capacity();

        int recordsRead = 0;
        int offset = 0;

        while (offset < capacity)
        {
            final long observationCount = buffer.getLongVolatile(offset + OBSERVATION_COUNT_OFFSET);
            if (observationCount <= 0)
            {
                break;
            }

            ++recordsRead;

            final String channel = buffer.getStringAscii(offset + CHANNEL_OFFSET);
            final String source = buffer.getStringAscii(offset + CHANNEL_OFFSET + SIZE_OF_INT + channel.length());

            entryConsumer.accept(
                observationCount,
                buffer.getLong(offset + TOTAL_BYTES_LOST_OFFSET),
                buffer.getLong(offset + FIRST_OBSERVATION_OFFSET),
                buffer.getLong(offset + LAST_OBSERVATION_OFFSET),
                buffer.getInt(offset + SESSION_ID_OFFSET),
                buffer.getInt(offset + STREAM_ID_OFFSET),
                channel,
                source);

            final int recordLength = CHANNEL_OFFSET + (SIZE_OF_INT * 2) + channel.length() + source.length();
            offset += BitUtil.align(recordLength, ENTRY_ALIGNMENT);
        }

        return recordsRead;
    }
public static int read ( final AtomicBuffer buffer , final EntryConsumer entryConsumer ) { final int capacity = buffer . capacity ( ) ; int recordsRead = 0 ; int offset = 0 ; while ( offset < capacity ) { final long observationCount = buffer . getLongVolatile ( offset + OBSERVATION_COUNT_OFFSET ) ; if ( observationCount <= 0 ) { break ; } ++ recordsRead ; final String channel = buffer . getStringAscii ( offset + CHANNEL_OFFSET ) ; final String source = buffer . getStringAscii ( offset + CHANNEL_OFFSET + SIZE_OF_INT + channel . length ( ) ) ; entryConsumer . accept ( observationCount , buffer . getLong ( offset + TOTAL_BYTES_LOST_OFFSET ) , buffer . getLong ( offset + FIRST_OBSERVATION_OFFSET ) , buffer . getLong ( offset + LAST_OBSERVATION_OFFSET ) , buffer . getInt ( offset + SESSION_ID_OFFSET ) , buffer . getInt ( offset + STREAM_ID_OFFSET ) , channel , source ) ; final int recordLength = CHANNEL_OFFSET + ( SIZE_OF_INT * 2 ) + channel . length ( ) + source . length ( ) ; offset += BitUtil . align ( recordLength , ENTRY_ALIGNMENT ) ; } return recordsRead ; }
Read a {@link LossReport} contained in the buffer. This can be done concurrently.

@param buffer        containing the loss report.
@param entryConsumer to be called to accept each entry in the report.
@return the number of entries read.
Read a { @link LossReport } contained in the buffer . This can be done concurrently .