use of org.agrona.MutableDirectBuffer in project deeplearning4j by deeplearning4j.
the class SbeStorageMetaData method decode.
@Override
public void decode(byte[] decode) {
MutableDirectBuffer buffer = new UnsafeBuffer(decode);
decode(buffer);
}
use of org.agrona.MutableDirectBuffer in project deeplearning4j by deeplearning4j.
the class SbeStorageMetaData method encode.
@Override
public byte[] encode() {
byte[] bytes = new byte[encodingLengthBytes()];
MutableDirectBuffer buffer = new UnsafeBuffer(bytes);
encode(buffer);
return bytes;
}
use of org.agrona.MutableDirectBuffer in project Aeron by real-logic.
the class EventLogger method logString.
private void logString(final EventCode code, final String value) {
final MutableDirectBuffer encodedBuffer = ENCODING_BUFFER.get();
final int encodingLength = EventEncoder.encode(encodedBuffer, value);
ringBuffer.write(code.id(), encodedBuffer, 0, encodingLength);
}
use of org.agrona.MutableDirectBuffer in project Aeron by real-logic.
the class EventLogger method logFrameOut.
public void logFrameOut(final ByteBuffer buffer, final InetSocketAddress dstAddress) {
if (IS_FRAME_OUT_ENABLED) {
final MutableDirectBuffer encodedBuffer = ENCODING_BUFFER.get();
final int encodedLength = EventEncoder.encode(encodedBuffer, buffer, buffer.position(), buffer.remaining(), dstAddress);
ringBuffer.write(EventCode.FRAME_OUT.id(), encodedBuffer, 0, encodedLength);
}
}
use of org.agrona.MutableDirectBuffer in project Aeron by real-logic.
the class EventLogger method logFrameIn.
public void logFrameIn(final DirectBuffer buffer, final int offset, final int length, final InetSocketAddress dstAddress) {
if (IS_FRAME_IN_ENABLED) {
final MutableDirectBuffer encodedBuffer = ENCODING_BUFFER.get();
final int encodedLength = EventEncoder.encode(encodedBuffer, buffer, offset, length, dstAddress);
ringBuffer.write(EventCode.FRAME_IN.id(), encodedBuffer, 0, encodedLength);
}
}
Aggregations