Buffer#forEachComponent().
| Modifier and Type | Method and Description |
|---|---|
| public long | Returns: The base native memory address, if any, otherwise 0.Give the base native memory address backing this buffer, or return 0 if this buffer has no native memory address. |
| public boolean | hasReadableArray()
Check if this component is backed by a cached byte array that can be accessed cheaply. |
| public boolean | hasWritableArray()
Check if this component is backed by a cached byte array that can be accessed cheaply. |
| public ByteCursor | Returns: AByteCursor for iterating the readable bytes of this buffer.Open a cursor to iterate the readable bytes of this component. |
| public byte[] | Returns: A byte array of the contents of this component.Get a byte array of the contents of this component. |
| public int | Returns: The number of bytes, from thereadableArrayOffset() into the readableArray(),
that belong to this component.The number of bytes in the |
| public int | Returns: An offset intoreadableArray().An offset into the |
| public ByteBuffer | Returns: A newByteBuffer, with its own position and limit, for this memory component.Get a |
| public int | Returns: The number of bytes that can be read from this readable component.Get the number of readable bytes from this component. |
| public long | Returns: The readable native memory address, if any, otherwise 0.Give the native memory address backing this buffer, or return 0 if this buffer has no native memory address. |
| public BufferComponent | Returns: itself.The number of bytes read from this component. byteCount)Move the read-offset to indicate that the given number of bytes were read from this component. |
| public BufferComponent | Returns: itself.The number of bytes written to this component. byteCount)Move the write-offset to indicate that the given number of bytes were written to this component. |
| public byte[] | Returns: A byte array of the contents of this component.Get a byte array of the contents of this component. |
| public int | Returns: The number of bytes, from thewritableArrayOffset() into the writableArray(),
that belong to this component.The number of bytes in the |
| public int | Returns: An offset intowritableArray().An offset into the |
| public ByteBuffer | Returns: A newByteBuffer, with its own position and limit, for this memory component.Get a |
| public int | Returns: The maximum number of bytes that can be written to this component.Get the space available to be written to this component, as a number of bytes. |
| public long | Returns: The writable native memory address, if any, otherwise 0.Give the native memory address backing this buffer, or return 0 if this buffer has no native memory address. |
| baseNativeAddress | back to summary |
|---|---|
| public long baseNativeAddress() Give the base native memory address backing this buffer, or return 0 if this buffer has no native memory address.
The base native address, is the address that the buffer components internal read- and write-offsets are
relative to, and which is used to compute the Note that the address should not be used for reading or writing. It should only be used for offset calculations.
| |
| hasReadableArray | back to summary |
|---|---|
| public boolean hasReadableArray() Check if this component is backed by a cached byte array that can be accessed cheaply. Note that regardless of what this method returns, the array should not be used to modify the contents of this buffer component.
| |
| hasWritableArray | back to summary |
|---|---|
| public boolean hasWritableArray() Check if this component is backed by a cached byte array that can be accessed cheaply.
| |
| openCursor | back to summary |
|---|---|
| public ByteCursor openCursor() Open a cursor to iterate the readable bytes of this component. Any offsets internal to the component are not modified by the cursor.
Care should be taken to ensure that the buffers lifetime extends beyond the cursor and the iteration, and that
the internal offsets of the component (such as
| |
| readableArray | back to summary |
|---|---|
| public byte[] readableArray() Get a byte array of the contents of this component. Note that the array is meant to be read-only. It may either be a direct reference to the concrete array instance that is backing this component, or it is a fresh copy. Writing to the array may produce undefined behaviour.
| |
| readableArrayLength | back to summary |
|---|---|
| public int readableArrayLength() The number of bytes in the
| |
| readableArrayOffset | back to summary |
|---|---|
| public int readableArrayOffset() An offset into the
| |
| readableBuffer | back to summary |
|---|---|
| public ByteBuffer readableBuffer() Get a Note that the
| |
| readableBytes | back to summary |
|---|---|
| public int readableBytes() Get the number of readable bytes from this component.
| |
| readableNativeAddress | back to summary |
|---|---|
| public long readableNativeAddress() Give the native memory address backing this buffer, or return 0 if this buffer has no native memory address. Note that the address should not be used for writing to the buffer memory, and doing so may produce undefined behaviour.
| |
| skipReadableBytes | back to summary |
|---|---|
| public BufferComponent skipReadableBytes(int byteCount) Move the read-offset to indicate that the given number of bytes were read from this component.
| |
| skipWritableBytes | back to summary |
|---|---|
| public BufferComponent skipWritableBytes(int byteCount) Move the write-offset to indicate that the given number of bytes were written to this component.
| |
| writableArray | back to summary |
|---|---|
| public byte[] writableArray() Get a byte array of the contents of this component.
| |
| writableArrayLength | back to summary |
|---|---|
| public int writableArrayLength() The number of bytes in the
| |
| writableArrayOffset | back to summary |
|---|---|
| public int writableArrayOffset() An offset into the
| |
| writableBuffer | back to summary |
|---|---|
| public ByteBuffer writableBuffer() Get a
| |
| writableBytes | back to summary |
|---|---|
| public int writableBytes() Get the space available to be written to this component, as a number of bytes.
| |
| writableNativeAddress | back to summary |
|---|---|
| public long writableNativeAddress() Give the native memory address backing this buffer, or return 0 if this buffer has no native memory address.
| |