public void putBytes(final int index, final byte[] src) { putBytes(index, src, 0, src.length); }
public void putBytes(final int index, final ByteBuffer srcBuffer, final int length) { final int srcIndex = srcBuffer.position(); putBytes(index, srcBuffer, srcIndex, length); srcBuffer.position(srcIndex + length); }
putBytes(index, MIN_INTEGER_VALUE); return MIN_INTEGER_VALUE.length;
putBytes(index, MIN_LONG_VALUE); return MIN_LONG_VALUE.length;
public void putBytes(final int index, final byte[] src) { putBytes(index, src, 0, src.length); }
private void moveValuesRight(final int srcOffset, final int requiredLength) { if (srcOffset < bufferLength) { final int targetOffset = srcOffset + requiredLength; final int copyLength = bufferLength - srcOffset; buffer.putBytes(targetOffset, buffer, srcOffset, copyLength); } bufferLength += requiredLength; }
private void moveValuesLeft(final int srcOffset, final int removedLength) { if (srcOffset <= bufferLength) { final int targetOffset = srcOffset - removedLength; final int copyLength = bufferLength - srcOffset; buffer.putBytes(targetOffset, buffer, srcOffset, copyLength); } bufferLength -= removedLength; }
private void moveValuesLeft(final int srcOffset, final int removedLength) { if (srcOffset <= bufferLength) { final int targetOffset = srcOffset - removedLength; final int copyLength = bufferLength - srcOffset; buffer.putBytes(targetOffset, buffer, srcOffset, copyLength); } bufferLength -= removedLength; }
private void moveValuesRight(final int srcOffset, final int requiredLength) { if (srcOffset < bufferLength) { final int targetOffset = srcOffset + requiredLength; final int copyLength = bufferLength - srcOffset; buffer.putBytes(targetOffset, buffer, srcOffset, copyLength); } bufferLength += requiredLength; }
public void putBytes(final int index, final byte[] src) { putBytes(index, src, 0, src.length); }
public int putStringWithoutLengthUtf8(final int index, final String value) { final byte[] bytes = value != null ? value.getBytes(UTF_8) : NULL_BYTES; putBytes(index, bytes); return bytes.length; }
public void putBytes(final int index, final ByteBuffer srcBuffer, final int length) { final int srcIndex = srcBuffer.position(); putBytes(index, srcBuffer, srcIndex, length); srcBuffer.position(srcIndex + length); }
public void putBytes(final int index, final ByteBuffer srcBuffer, final int length) { final int srcIndex = srcBuffer.position(); putBytes(index, srcBuffer, srcIndex, length); srcBuffer.position(srcIndex + length); }
public int putStringUtf8(final int index, final String value, final int maxEncodedSize) { final byte[] bytes = value != null ? value.getBytes(UTF_8) : NULL_BYTES; if (bytes.length > maxEncodedSize) { throw new IllegalArgumentException("Encoded string larger than maximum size: " + maxEncodedSize); } putInt(index, bytes.length); putBytes(index + SIZE_OF_INT, bytes); return SIZE_OF_INT + bytes.length; }
public int putStringUtf8(final int index, final String value, final ByteOrder byteOrder, final int maxEncodedSize) { final byte[] bytes = value != null ? value.getBytes(UTF_8) : NULL_BYTES; if (bytes.length > maxEncodedSize) { throw new IllegalArgumentException("Encoded string larger than maximum size: " + maxEncodedSize); } putInt(index, bytes.length, byteOrder); putBytes(index + SIZE_OF_INT, bytes); return SIZE_OF_INT + bytes.length; }
@Override public void wrap(DirectBuffer buffer, int offset, int length) { value.putBytes(0, buffer, offset, length); view.wrap(value, 0, length); } }
private void reprocessPendingDeployments() { deploymentsState.foreachPending( ((pendingDeploymentDistribution, key) -> { final ExpandableArrayBuffer buffer = new ExpandableArrayBuffer(); final DirectBuffer deployment = pendingDeploymentDistribution.getDeployment(); buffer.putBytes(0, deployment, 0, deployment.capacity()); distributeDeployment(key, pendingDeploymentDistribution.getSourcePosition(), buffer); })); }
private void reprocessPendingDeployments() { deploymentsState.foreachPending( ((pendingDeploymentDistribution, key) -> { final ExpandableArrayBuffer buffer = new ExpandableArrayBuffer(); final DirectBuffer deployment = pendingDeploymentDistribution.getDeployment(); buffer.putBytes(0, deployment, 0, deployment.capacity()); distributeDeployment(key, pendingDeploymentDistribution.getSourcePosition(), buffer); })); }
putBytes(index, MIN_INTEGER_VALUE); return MIN_INTEGER_VALUE.length;
putBytes(index, MIN_LONG_VALUE); return MIN_LONG_VALUE.length;