public ControlMessageResponseDecoder wrap( final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) { if (buffer != this.buffer) { this.buffer = buffer; } this.offset = offset; this.actingBlockLength = actingBlockLength; this.actingVersion = actingVersion; limit(offset + actingBlockLength); return this; }
public ControlMessageResponseDecoder wrap( final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) { if (buffer != this.buffer) { this.buffer = buffer; } this.offset = offset; this.actingBlockLength = actingBlockLength; this.actingVersion = actingVersion; limit(offset + actingBlockLength); return this; }
public int dataLength() { final int limit = parentMessage.limit(); return (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); }
public int getData(final MutableDirectBuffer dst, final int dstOffset, final int length) { final int headerLength = 2; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); final int bytesCopied = Math.min(length, dataLength); parentMessage.limit(limit + headerLength + dataLength); buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied); return bytesCopied; }
public int getData(final byte[] dst, final int dstOffset, final int length) { final int headerLength = 2; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); final int bytesCopied = Math.min(length, dataLength); parentMessage.limit(limit + headerLength + dataLength); buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied); return bytesCopied; }
public void wrapData(final DirectBuffer wrapBuffer) { final int headerLength = 2; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); parentMessage.limit(limit + headerLength + dataLength); wrapBuffer.wrap(buffer, limit + headerLength, dataLength); }
public int dataLength() { final int limit = parentMessage.limit(); return (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); }
public int getData(final MutableDirectBuffer dst, final int dstOffset, final int length) { final int headerLength = 2; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); final int bytesCopied = Math.min(length, dataLength); parentMessage.limit(limit + headerLength + dataLength); buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied); return bytesCopied; }
public int getData(final byte[] dst, final int dstOffset, final int length) { final int headerLength = 2; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); final int bytesCopied = Math.min(length, dataLength); parentMessage.limit(limit + headerLength + dataLength); buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied); return bytesCopied; }
public void wrapData(final DirectBuffer wrapBuffer) { final int headerLength = 2; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); parentMessage.limit(limit + headerLength + dataLength); wrapBuffer.wrap(buffer, limit + headerLength, dataLength); }
public String data() { final int headerLength = 2; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); parentMessage.limit(limit + headerLength + dataLength); if (0 == dataLength) { return ""; } final byte[] tmp = new byte[dataLength]; buffer.getBytes(limit + headerLength, tmp, 0, dataLength); final String value; try { value = new String(tmp, "UTF-8"); } catch (final java.io.UnsupportedEncodingException ex) { throw new RuntimeException(ex); } return value; }
public String data() { final int headerLength = 2; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); parentMessage.limit(limit + headerLength + dataLength); if (0 == dataLength) { return ""; } final byte[] tmp = new byte[dataLength]; buffer.getBytes(limit + headerLength, tmp, 0, dataLength); final String value; try { value = new String(tmp, "UTF-8"); } catch (final java.io.UnsupportedEncodingException ex) { throw new RuntimeException(ex); } return value; }
@Override public void wrap(DirectBuffer buffer, int offset, int length) { reset(); final int frameEnd = offset + length; headerDecoder.wrap(buffer, offset); offset += headerDecoder.encodedLength(); bodyDecoder.wrap(buffer, offset, headerDecoder.blockLength(), headerDecoder.version()); offset += bodyDecoder.sbeBlockLength(); final int dataLength = bodyDecoder.dataLength(); offset += ControlMessageResponseDecoder.dataHeaderLength(); data.wrap(buffer, offset, dataLength); offset += dataLength; bodyDecoder.limit(offset); assert bodyDecoder.limit() == frameEnd : "Decoder read only to position " + bodyDecoder.limit() + " but expected " + frameEnd + " as final position"; }