public ExecuteCommandResponseEncoder wrap(final MutableDirectBuffer buffer, final int offset) { if (buffer != this.buffer) { this.buffer = buffer; } this.offset = offset; limit(offset + BLOCK_LENGTH); return this; }
public ExecuteCommandResponseEncoder wrap(final MutableDirectBuffer buffer, final int offset) { if (buffer != this.buffer) { this.buffer = buffer; } this.offset = offset; limit(offset + BLOCK_LENGTH); return this; }
public ExecuteCommandResponseEncoder putRejectionReason(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 ExecuteCommandResponseEncoder putRejectionReason(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 ExecuteCommandResponseEncoder putRejectionReason(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 ExecuteCommandResponseEncoder putValue(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 ExecuteCommandResponseEncoder putValue(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 ExecuteCommandResponseEncoder putValue(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 ExecuteCommandResponseEncoder putValue(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 ExecuteCommandResponseEncoder putRejectionReason(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 ExecuteCommandResponseEncoder value(final String value) { final byte[] bytes; try { bytes = null == value || value.isEmpty() ? org.agrona.collections.ArrayUtil.EMPTY_BYTE_ARRAY : value.getBytes("UTF-8"); } catch (final java.io.UnsupportedEncodingException ex) { throw new RuntimeException(ex); } final int length = bytes.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, bytes, 0, length); return this; }
public ExecuteCommandResponseEncoder rejectionReason(final String value) { final byte[] bytes; try { bytes = null == value || value.isEmpty() ? org.agrona.collections.ArrayUtil.EMPTY_BYTE_ARRAY : value.getBytes("UTF-8"); } catch (final java.io.UnsupportedEncodingException ex) { throw new RuntimeException(ex); } final int length = bytes.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, bytes, 0, length); return this; }
public ExecuteCommandResponseEncoder rejectionReason(final String value) { final byte[] bytes; try { bytes = null == value || value.isEmpty() ? org.agrona.collections.ArrayUtil.EMPTY_BYTE_ARRAY : value.getBytes("UTF-8"); } catch (final java.io.UnsupportedEncodingException ex) { throw new RuntimeException(ex); } final int length = bytes.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, bytes, 0, length); return this; }
public ExecuteCommandResponseEncoder value(final String value) { final byte[] bytes; try { bytes = null == value || value.isEmpty() ? org.agrona.collections.ArrayUtil.EMPTY_BYTE_ARRAY : value.getBytes("UTF-8"); } catch (final java.io.UnsupportedEncodingException ex) { throw new RuntimeException(ex); } final int length = bytes.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, bytes, 0, length); return this; }
@Override public void write(final MutableDirectBuffer buffer, int offset) { // protocol header messageHeaderEncoder .wrap(buffer, offset) .blockLength(responseEncoder.sbeBlockLength()) .templateId(responseEncoder.sbeTemplateId()) .schemaId(responseEncoder.sbeSchemaId()) .version(responseEncoder.sbeSchemaVersion()); offset += messageHeaderEncoder.encodedLength(); // protocol message responseEncoder .wrap(buffer, offset) .recordType(recordType) .partitionId(partitionId) .valueType(valueType) .intent(intent) .key(key) .rejectionType(rejectionType); offset = responseEncoder.limit(); final int eventLength = valueWriter.getLength(); buffer.putShort(offset, (short) eventLength, Protocol.ENDIANNESS); offset += valueHeaderLength(); valueWriter.write(buffer, offset); offset += eventLength; responseEncoder.limit(offset); responseEncoder.putRejectionReason(rejectionReason, 0, rejectionReason.capacity()); }
@Override public void write(final MutableDirectBuffer buffer, int offset) { // protocol header messageHeaderEncoder .wrap(buffer, offset) .blockLength(responseEncoder.sbeBlockLength()) .templateId(responseEncoder.sbeTemplateId()) .schemaId(responseEncoder.sbeSchemaId()) .version(responseEncoder.sbeSchemaVersion()); offset += messageHeaderEncoder.encodedLength(); // protocol message responseEncoder .wrap(buffer, offset) .recordType(recordType) .partitionId(partitionId) .valueType(valueType) .intent(intent) .key(key) .rejectionType(rejectionType); offset = responseEncoder.limit(); final int eventLength = valueWriter.getLength(); buffer.putShort(offset, (short) eventLength, Protocol.ENDIANNESS); offset += valueHeaderLength(); valueWriter.write(buffer, offset); offset += eventLength; responseEncoder.limit(offset); responseEncoder.putRejectionReason(rejectionReason, 0, rejectionReason.capacity()); }