Search in sources :

Example 11 with MutableDirectBuffer

use of org.agrona.MutableDirectBuffer in project Aeron by real-logic.

the class EventLogger method log.

public void log(final EventCode code, final DirectBuffer buffer, final int offset, final int length) {
    if (EventCode.isEnabled(code, ENABLED_EVENT_CODES)) {
        final MutableDirectBuffer encodedBuffer = ENCODING_BUFFER.get();
        final int encodedLength = EventEncoder.encode(encodedBuffer, buffer, offset, length);
        ringBuffer.write(code.id(), encodedBuffer, 0, encodedLength);
    }
}
Also used : MutableDirectBuffer(org.agrona.MutableDirectBuffer)

Aggregations

MutableDirectBuffer (org.agrona.MutableDirectBuffer)11 UnsafeBuffer (org.agrona.concurrent.UnsafeBuffer)6 Before (org.junit.Before)1