@Test public void shouldExposePositionAtWhichHeapByteBufferGetsWrapped() { final ByteBuffer wibbleByteBuffer = ByteBuffer.wrap(wibbleBytes); shouldExposePositionAtWhichByteBufferGetsWrapped(wibbleByteBuffer); }
public void wrap(final byte[] buffer) { addressOffset = ARRAY_BASE_OFFSET; capacity = buffer.length; byteBuffer = null; if (buffer != byteArray) { byteArray = buffer; } }
UnsafeBuffer implements AtomicBuffer { public void wrap(final byte[] buffer) { addressOffset = ARRAY_BASE_OFFSET; capacity = buffer.length; byteBuffer = null; if (buffer != byteArray) { byteArray = buffer; } } }
UnsafeBuffer implements AtomicBuffer { public void wrap(final byte[] buffer) { addressOffset = ARRAY_BASE_OFFSET; capacity = buffer.length; byteBuffer = null; if (buffer != byteArray) { byteArray = buffer; } } UnsafeBuffer();  UnsafeBuffer(final byte[] buffer);  UnsafeBuffer(final byte[] buffer, final int offset, final int length);  UnsafeBuffer(final ByteBuffer buffer);  UnsafeBuffer(final ByteBuffer buffer, final int offset, final int length);  UnsafeBuffer(final DirectBuffer buffer);  UnsafeBuffer(final DirectBuffer buffer, final int offset, final int length);  UnsafeBuffer(final long address, final int length); }
UnsafeBuffer implements AtomicBuffer { public void wrap(final byte[] buffer) { addressOffset = ARRAY_BASE_OFFSET; capacity = buffer.length; byteBuffer = null; if (buffer != byteArray) { byteArray = buffer; } } UnsafeBuffer();  UnsafeBuffer(final byte[] buffer);  UnsafeBuffer(final byte[] buffer, final int offset, final int length);  UnsafeBuffer(final ByteBuffer buffer);  UnsafeBuffer(final ByteBuffer buffer, final int offset, final int length);  UnsafeBuffer(final DirectBuffer buffer);  UnsafeBuffer(final DirectBuffer buffer, final int offset, final int length);  UnsafeBuffer(final long address, final int length); void wrap(final byte[] buffer); void wrap(final byte[] buffer, final int offset, final int length); void wrap(final ByteBuffer buffer); void wrap(final ByteBuffer buffer, final int offset, final int length); void wrap(final DirectBuffer buffer); void wrap(final DirectBuffer buffer, final int offset, final int length); void wrap(final long address, final int length); long addressOffset(); byte[] byteArray(); ByteBuffer byteBuffer(); void setMemory(final int index, final int length, final byte value); int capacity(); void checkLimit(final int limit); boolean isExpandable(); void verifyAlignment(); long getLong(final int index, final ByteOrder byteOrder); void putLong(final int index, final long value, final ByteOrder byteOrder); long getLong(final int index); void putLong(final int index, final long value); long getLongVolatile(final int index); void putLongVolatile(final int index, final long value); void putLongOrdered(final int index, final long value); long addLongOrdered(final int index, final long increment); boolean compareAndSetLong(final int index, final long expectedValue, final long updateValue); long getAndSetLong(final int index, final long value); long getAndAddLong(final int index, final long delta); int getInt(final int index, final ByteOrder byteOrder); void putInt(final int index, final int value, final ByteOrder byteOrder); int getInt(final int index); void putInt(final int index, final int value); int getIntVolatile(final int index); void putIntVolatile(final int index, final int value); void putIntOrdered(final int index, final int value); int addIntOrdered(final int index, final int increment); boolean compareAndSetInt(final int index, final int expectedValue, final int updateValue); int getAndSetInt(final int index, final int value); int getAndAddInt(final int index, final int delta); double getDouble(final int index, final ByteOrder byteOrder); void putDouble(final int index, final double value, final ByteOrder byteOrder); double getDouble(final int index); void putDouble(final int index, final double value); float getFloat(final int index, final ByteOrder byteOrder); void putFloat(final int index, final float value, final ByteOrder byteOrder); float getFloat(final int index); void putFloat(final int index, final float value); short getShort(final int index, final ByteOrder byteOrder); void putShort(final int index, final short value, final ByteOrder byteOrder); short getShort(final int index); void putShort(final int index, final short value); short getShortVolatile(final int index); void putShortVolatile(final int index, final short value); byte getByte(final int index); void putByte(final int index, final byte value); byte getByteVolatile(final int index); void putByteVolatile(final int index, final byte value); void getBytes(final int index, final byte[] dst); void getBytes(final int index, final byte[] dst, final int offset, final int length); void getBytes(final int index, final MutableDirectBuffer dstBuffer, final int dstIndex, final int length); void getBytes(final int index, final ByteBuffer dstBuffer, final int length); void getBytes(final int index, final ByteBuffer dstBuffer, final int dstOffset, final int length); void putBytes(final int index, final byte[] src); void putBytes(final int index, final byte[] src, final int offset, final int length); void putBytes(final int index, final ByteBuffer srcBuffer, final int length); void putBytes(final int index, final ByteBuffer srcBuffer, final int srcIndex, final int length); void putBytes(final int index, final DirectBuffer srcBuffer, final int srcIndex, final int length); char getChar(final int index, final ByteOrder byteOrder); void putChar(final int index, final char value, final ByteOrder byteOrder); char getChar(final int index); void putChar(final int index, final char value); char getCharVolatile(final int index); void putCharVolatile(final int index, final char value); String getStringAscii(final int index); int getStringAscii(final int index, final Appendable appendable); String getStringAscii(final int index, final ByteOrder byteOrder); int getStringAscii(final int index, final Appendable appendable, final ByteOrder byteOrder); String getStringAscii(final int index, final int length); int getStringAscii(final int index, final int length, final Appendable appendable); int putStringAscii(final int index, final String value); int putStringAscii(final int index, final String value, final ByteOrder byteOrder); String getStringWithoutLengthAscii(final int index, final int length); int getStringWithoutLengthAscii(final int index, final int length, final Appendable appendable); int putStringWithoutLengthAscii(final int index, final String value); int putStringWithoutLengthAscii(final int index, final String value, final int valueOffset, final int length); String getStringUtf8(final int index); String getStringUtf8(final int index, final ByteOrder byteOrder); String getStringUtf8(final int index, final int length); int putStringUtf8(final int index, final String value); int putStringUtf8(final int index, final String value, final ByteOrder byteOrder); int putStringUtf8(final int index, final String value, final int maxEncodedLength); int putStringUtf8(final int index, final String value, final ByteOrder byteOrder, final int maxEncodedLength); String getStringWithoutLengthUtf8(final int index, final int length); int putStringWithoutLengthUtf8(final int index, final String value); int parseNaturalIntAscii(final int index, final int length); long parseNaturalLongAscii(final int index, final int length); int parseIntAscii(final int index, final int length); long parseLongAscii(final int index, final int length); int putIntAscii(final int index, final int value); int putNaturalIntAscii(final int index, final int value); void putNaturalPaddedIntAscii(final int offset, final int length, final int value); int putNaturalIntAsciiFromEnd(final int value, final int endExclusive); int putNaturalLongAscii(final int index, final long value); int putLongAscii(final int index, final long value); void boundsCheck(final int index, final int length); int wrapAdjustment(); boolean equals(final Object obj); int hashCode(); int compareTo(final DirectBuffer that); String toString(); }
UnsafeBuffer implements AtomicBuffer { public void wrap(final byte[] buffer) { addressOffset = ARRAY_BASE_OFFSET; capacity = buffer.length; byteBuffer = null; if (buffer != byteArray) { byteArray = buffer; } } UnsafeBuffer();  UnsafeBuffer(final byte[] buffer);  UnsafeBuffer(final byte[] buffer, final int offset, final int length);  UnsafeBuffer(final ByteBuffer buffer);  UnsafeBuffer(final ByteBuffer buffer, final int offset, final int length);  UnsafeBuffer(final DirectBuffer buffer);  UnsafeBuffer(final DirectBuffer buffer, final int offset, final int length);  UnsafeBuffer(final long address, final int length); void wrap(final byte[] buffer); void wrap(final byte[] buffer, final int offset, final int length); void wrap(final ByteBuffer buffer); void wrap(final ByteBuffer buffer, final int offset, final int length); void wrap(final DirectBuffer buffer); void wrap(final DirectBuffer buffer, final int offset, final int length); void wrap(final long address, final int length); long addressOffset(); byte[] byteArray(); ByteBuffer byteBuffer(); void setMemory(final int index, final int length, final byte value); int capacity(); void checkLimit(final int limit); boolean isExpandable(); void verifyAlignment(); long getLong(final int index, final ByteOrder byteOrder); void putLong(final int index, final long value, final ByteOrder byteOrder); long getLong(final int index); void putLong(final int index, final long value); long getLongVolatile(final int index); void putLongVolatile(final int index, final long value); void putLongOrdered(final int index, final long value); long addLongOrdered(final int index, final long increment); boolean compareAndSetLong(final int index, final long expectedValue, final long updateValue); long getAndSetLong(final int index, final long value); long getAndAddLong(final int index, final long delta); int getInt(final int index, final ByteOrder byteOrder); void putInt(final int index, final int value, final ByteOrder byteOrder); int getInt(final int index); void putInt(final int index, final int value); int getIntVolatile(final int index); void putIntVolatile(final int index, final int value); void putIntOrdered(final int index, final int value); int addIntOrdered(final int index, final int increment); boolean compareAndSetInt(final int index, final int expectedValue, final int updateValue); int getAndSetInt(final int index, final int value); int getAndAddInt(final int index, final int delta); double getDouble(final int index, final ByteOrder byteOrder); void putDouble(final int index, final double value, final ByteOrder byteOrder); double getDouble(final int index); void putDouble(final int index, final double value); float getFloat(final int index, final ByteOrder byteOrder); void putFloat(final int index, final float value, final ByteOrder byteOrder); float getFloat(final int index); void putFloat(final int index, final float value); short getShort(final int index, final ByteOrder byteOrder); void putShort(final int index, final short value, final ByteOrder byteOrder); short getShort(final int index); void putShort(final int index, final short value); short getShortVolatile(final int index); void putShortVolatile(final int index, final short value); byte getByte(final int index); void putByte(final int index, final byte value); byte getByteVolatile(final int index); void putByteVolatile(final int index, final byte value); void getBytes(final int index, final byte[] dst); void getBytes(final int index, final byte[] dst, final int offset, final int length); void getBytes(final int index, final MutableDirectBuffer dstBuffer, final int dstIndex, final int length); void getBytes(final int index, final ByteBuffer dstBuffer, final int length); void getBytes(final int index, final ByteBuffer dstBuffer, final int dstOffset, final int length); void putBytes(final int index, final byte[] src); void putBytes(final int index, final byte[] src, final int offset, final int length); void putBytes(final int index, final ByteBuffer srcBuffer, final int length); void putBytes(final int index, final ByteBuffer srcBuffer, final int srcIndex, final int length); void putBytes(final int index, final DirectBuffer srcBuffer, final int srcIndex, final int length); char getChar(final int index, final ByteOrder byteOrder); void putChar(final int index, final char value, final ByteOrder byteOrder); char getChar(final int index); void putChar(final int index, final char value); char getCharVolatile(final int index); void putCharVolatile(final int index, final char value); String getStringAscii(final int index); int getStringAscii(final int index, final Appendable appendable); String getStringAscii(final int index, final ByteOrder byteOrder); int getStringAscii(final int index, final Appendable appendable, final ByteOrder byteOrder); String getStringAscii(final int index, final int length); int getStringAscii(final int index, final int length, final Appendable appendable); int putStringAscii(final int index, final String value); int putStringAscii(final int index, final String value, final ByteOrder byteOrder); String getStringWithoutLengthAscii(final int index, final int length); int getStringWithoutLengthAscii(final int index, final int length, final Appendable appendable); int putStringWithoutLengthAscii(final int index, final String value); int putStringWithoutLengthAscii(final int index, final String value, final int valueOffset, final int length); String getStringUtf8(final int index); String getStringUtf8(final int index, final ByteOrder byteOrder); String getStringUtf8(final int index, final int length); int putStringUtf8(final int index, final String value); int putStringUtf8(final int index, final String value, final ByteOrder byteOrder); int putStringUtf8(final int index, final String value, final int maxEncodedLength); int putStringUtf8(final int index, final String value, final ByteOrder byteOrder, final int maxEncodedLength); String getStringWithoutLengthUtf8(final int index, final int length); int putStringWithoutLengthUtf8(final int index, final String value); int parseNaturalIntAscii(final int index, final int length); long parseNaturalLongAscii(final int index, final int length); int parseIntAscii(final int index, final int length); long parseLongAscii(final int index, final int length); int putIntAscii(final int index, final int value); int putNaturalIntAscii(final int index, final int value); void putNaturalPaddedIntAscii(final int offset, final int length, final int value); int putNaturalIntAsciiFromEnd(final int value, final int endExclusive); int putNaturalLongAscii(final int index, final long value); int putLongAscii(final int index, final long value); void boundsCheck(final int index, final int length); int wrapAdjustment(); boolean equals(final Object obj); int hashCode(); int compareTo(final DirectBuffer that); String toString(); static final int ALIGNMENT; static final String DISABLE_BOUNDS_CHECKS_PROP_NAME; static final boolean SHOULD_BOUNDS_CHECK; }