/** * Write a byte[] to the buffer. * * @param srcBytes to write * @param srcOffset at which to begin reading bytes from the srcBytes. * @param length of the srcBytes to read. */ public void write(final byte[] srcBytes, final int srcOffset, final int length) { buffer.putBytes(offset + position, srcBytes, srcOffset, length); position += length; }
public static int encode( final MutableDirectBuffer encodingBuffer, final DirectBuffer buffer, final int offset, final int length) { final int captureLength = determineCaptureLength(length); int relativeOffset = encodeLogHeader(encodingBuffer, captureLength, length); encodingBuffer.putBytes(relativeOffset, buffer, offset, captureLength); relativeOffset += captureLength; return relativeOffset; }
/** * Fill the key buffer. * * @param keyBuffer containing the optional key for the counter. * @param keyOffset within the keyBuffer at which the key begins. * @param keyLength of the key in the keyBuffer. * @return flyweight */ public CounterMessageFlyweight keyBuffer(final DirectBuffer keyBuffer, final int keyOffset, final int keyLength) { buffer.putInt(KEY_LENGTH_OFFSET, keyLength); if (null != keyBuffer && keyLength > 0) { buffer.putBytes(keyBufferOffset(), keyBuffer, keyOffset, keyLength); } return this; }
public TokenCodecEncoder putNullValue(final byte[] src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public TokenCodecEncoder putReferencedName(final byte[] src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public FrameCodecEncoder putNamespaceName(final DirectBuffer src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public FrameCodecEncoder putSemanticVersion(final DirectBuffer src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public FrameCodecEncoder putSemanticVersion(final byte[] src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public TokenCodecEncoder putMaxValue(final DirectBuffer src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public TokenCodecEncoder putCharacterEncoding(final byte[] src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public TokenCodecEncoder putDescription(final DirectBuffer src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public FrameCodecEncoder putPackageName(final DirectBuffer src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public FrameCodecEncoder putNamespaceName(final byte[] src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public TokenCodecEncoder putName(final byte[] src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public TokenCodecEncoder putConstValue(final DirectBuffer src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public TokenCodecEncoder putCharacterEncoding(final DirectBuffer src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public FrameCodecEncoder putPackageName(final byte[] src, final int srcOffset, final int length) { if (length > 65534) { throw new IllegalStateException("length > maxValue for type: " + length); } final int headerLength = 2; final int limit = parentMessage.limit(); parentMessage.limit(limit + headerLength + length); buffer.putShort(limit, (short)length, java.nio.ByteOrder.LITTLE_ENDIAN); buffer.putBytes(limit + headerLength, src, srcOffset, length); return this; }
public static int encode( final MutableDirectBuffer encodingBuffer, final DirectBuffer buffer, final int offset, final int bufferLength, final InetSocketAddress dstAddress) { final int captureLength = determineCaptureLength(bufferLength); int relativeOffset = encodeLogHeader(encodingBuffer, captureLength, bufferLength); relativeOffset += encodeSocketAddress(encodingBuffer, relativeOffset, dstAddress); encodingBuffer.putBytes(relativeOffset, buffer, offset, captureLength); relativeOffset += captureLength; return relativeOffset; }
public static int encode( final MutableDirectBuffer encodingBuffer, final ByteBuffer buffer, final int offset, final int bufferLength, final InetSocketAddress dstAddress) { final int captureLength = determineCaptureLength(bufferLength); int relativeOffset = encodeLogHeader(encodingBuffer, captureLength, bufferLength); relativeOffset += encodeSocketAddress(encodingBuffer, relativeOffset, dstAddress); encodingBuffer.putBytes(relativeOffset, buffer, offset, captureLength); relativeOffset += captureLength; return relativeOffset; }
/** * Fill the label buffer. * * @param labelBuffer containing the mandatory label for the counter. * @param labelOffset within the labelBuffer at which the label begins. * @param labelLength of the label in the labelBuffer. * @return flyweight */ public CounterMessageFlyweight labelBuffer( final DirectBuffer labelBuffer, final int labelOffset, final int labelLength) { buffer.putInt(labelOffset(), labelLength); buffer.putBytes(labelBufferOffset(), labelBuffer, labelOffset, labelLength); return this; }