|
GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java (public API).
|
Utility methods allowing easy java.nio.Buffer manipulations.
More...
Classes | |
| class | Cleaner |
Access to NIO sun.misc.Cleaner, allowing caller to deterministically clean a given sun.nio.ch.DirectBuffer. More... | |
Static Public Member Functions | |
| static ByteBuffer | newDirectByteBuffer (final int numElements) |
| Allocates a new direct ByteBuffer with the specified number of elements. More... | |
| static ByteBuffer | newDirectByteBuffer (final byte[] values, final int offset, final int length) |
| static ByteBuffer | newDirectByteBuffer (final byte[] values, final int offset) |
| static ByteBuffer | newDirectByteBuffer (final byte[] values) |
| static DoubleBuffer | newDirectDoubleBuffer (final int numElements) |
| Allocates a new direct DoubleBuffer with the specified number of elements. More... | |
| static DoubleBuffer | newDirectDoubleBuffer (final double[] values, final int offset, final int length) |
| static DoubleBuffer | newDirectDoubleBuffer (final double[] values, final int offset) |
| static DoubleBuffer | newDirectDoubleBuffer (final double[] values) |
| static FloatBuffer | newDirectFloatBuffer (final int numElements) |
| Allocates a new direct FloatBuffer with the specified number of elements. More... | |
| static FloatBuffer | newDirectFloatBuffer (final float[] values, final int offset, final int length) |
| static FloatBuffer | newDirectFloatBuffer (final float[] values, final int offset) |
| static FloatBuffer | newDirectFloatBuffer (final float[] values) |
| static IntBuffer | newDirectIntBuffer (final int numElements) |
| Allocates a new direct IntBuffer with the specified number of elements. More... | |
| static IntBuffer | newDirectIntBuffer (final int[] values, final int offset, final int length) |
| static IntBuffer | newDirectIntBuffer (final int[] values, final int offset) |
| static IntBuffer | newDirectIntBuffer (final int[] values) |
| static LongBuffer | newDirectLongBuffer (final int numElements) |
| Allocates a new direct LongBuffer with the specified number of elements. More... | |
| static LongBuffer | newDirectLongBuffer (final long[] values, final int offset, final int length) |
| static LongBuffer | newDirectLongBuffer (final long[] values, final int offset) |
| static LongBuffer | newDirectLongBuffer (final long[] values) |
| static ShortBuffer | newDirectShortBuffer (final int numElements) |
| Allocates a new direct ShortBuffer with the specified number of elements. More... | |
| static ShortBuffer | newDirectShortBuffer (final short[] values, final int offset, final int length) |
| static ShortBuffer | newDirectShortBuffer (final short[] values, final int offset) |
| static ShortBuffer | newDirectShortBuffer (final short[] values) |
| static CharBuffer | newDirectCharBuffer (final int numElements) |
| Allocates a new direct CharBuffer with the specified number of elements. More... | |
| static CharBuffer | newDirectCharBuffer (final char[] values, final int offset, final int length) |
| static CharBuffer | newDirectCharBuffer (final char[] values, final int offset) |
| static CharBuffer | newDirectCharBuffer (final char[] values) |
| static ByteBuffer | nativeOrder (final ByteBuffer buf) |
| Helper routine to set a ByteBuffer to the native byte order, if that operation is supported by the underlying NIO implementation. More... | |
| static Class<? extends Buffer > | typeNameToBufferClass (final String typeName) |
Returns Buffer class matching the given lower case typeName More... | |
| static int | sizeOfBufferElem (final Class<? extends Buffer > bufferClz) |
Returns the size of a single element of the given buffer class in bytes or 0 if the given buffer is null. More... | |
| static int | sizeOfBufferElem (final Object buffer) |
Returns the size of a single element of the given buffer in bytes or 0 if the given buffer is null. More... | |
| static int | remainingElem (final Object buffer) throws IllegalArgumentException |
Returns the number of remaining elements of the given anonymous buffer. More... | |
| static int | remainingBytes (final Object buffer) throws IllegalArgumentException |
Returns the number of remaining bytes of the given anonymous buffer. More... | |
| static boolean | isDirect (final Object buf) |
| Helper routine to tell whether a buffer is direct or not. More... | |
| static int | getDirectBufferByteOffset (final Object buf) |
| Helper routine to get the Buffer byte offset by taking into account the Buffer position and the underlying type. More... | |
| static Object | getArray (final Object buf) throws UnsupportedOperationException, IllegalArgumentException |
| Helper routine to return the array backing store reference from a Buffer object. More... | |
| static int | getIndirectBufferByteOffset (final Object buf) |
| Helper routine to get the full byte offset from the beginning of the array that is the storage for the indirect Buffer object. More... | |
| static< B extends Buffer > B | slice (final B buffer) |
| Calls slice on the specified buffer while maintaining the byteorder. More... | |
| static< B extends Buffer > B | slice (final B buffer, final int offset, final int size) |
| Slices the specified buffer with offset as position and offset+size as limit while maintaining the byteorder. More... | |
| static final FloatBuffer | slice2Float (final Buffer buf, final int elementStartPos, final int elementCount) |
Slices a ByteBuffer or a FloatBuffer to a FloatBuffer at the given elementStartPos with the given elementCount in float-space. More... | |
| static final FloatBuffer | slice2Float (final float[] backing, final int elementStartPos, final int elementCount) |
Slices a primitive float backing array to a FloatBuffer at the given elementStartPos with the given elementCount in float-space by wrapping the backing array. More... | |
| static final ShortBuffer | slice2Short (final Buffer buf, final int elementStartPos, final int elementCount) |
Slices a ByteBuffer or a ShortBuffer to a ShortBuffer at the given elementStartPos with the given elementCount in short-space. More... | |
| static final ShortBuffer | slice2Short (final short[] backing, final int elementStartPos, final int elementCount) |
Slices a primitive float backing array to a ShortBuffer at the given elementStartPos with the given elementCount in short-space by wrapping the backing array. More... | |
| static final CharBuffer | slice2Char (final Buffer buf, final int elementStartPos, final int elementCount) |
Slices a ByteBuffer or a CharBuffer to a CharBuffer at the given elementStartPos with the given elementCount in short-space. More... | |
| static final CharBuffer | slice2Char (final char[] backing, final int elementStartPos, final int elementCount) |
Slices a primitive float backing array to a CharBuffer at the given elementStartPos with the given elementCount in short-space by wrapping the backing array. More... | |
| static final IntBuffer | slice2Int (final Buffer buf, final int elementStartPos, final int elementCount) |
Slices a ByteBuffer or a IntBuffer to a IntBuffer at the given elementStartPos with the given elementCount in int-space. More... | |
| static final IntBuffer | slice2Int (final int[] backing, final int elementStartPos, final int elementCount) |
Slices a primitive float backing array to a IntBuffer at the given elementStartPos with the given elementCount in int-space by wrapping the backing array. More... | |
| static final LongBuffer | slice2Long (final Buffer buf, final int elementStartPos, final int elementCount) |
Slices a ByteBuffer or a LongBuffer to a LongBuffer at the given elementStartPos with the given elementCount in long-space. More... | |
| static final LongBuffer | slice2Long (final long[] backing, final int elementStartPos, final int elementCount) |
Slices a primitive float backing array to a LongBuffer at the given elementStartPos with the given elementCount in long-space by wrapping the backing array. More... | |
| static final DoubleBuffer | slice2Double (final Buffer buf, final int elementStartPos, final int elementCount) |
Slices a ByteBuffer or a DoubleBuffer to a DoubleBuffer at the given elementStartPos with the given elementCount in double-space. More... | |
| static final DoubleBuffer | slice2Double (final double[] backing, final int elementStartPos, final int elementCount) |
Slices a primitive float backing array to a DoubleBuffer at the given elementStartPos with the given elementCount in double-space by wrapping the backing array. More... | |
| static ByteBuffer | copyByteBuffer (final ByteBuffer orig) |
Copies the remaining elements (as defined by limit() - position()) in the passed ByteBuffer into a newly-allocated direct ByteBuffer. More... | |
| static FloatBuffer | copyFloatBuffer (final FloatBuffer orig) |
Copies the remaining elements (as defined by limit() - position()) in the passed FloatBuffer into a newly-allocated direct FloatBuffer. More... | |
| static IntBuffer | copyIntBuffer (final IntBuffer orig) |
Copies the remaining elements (as defined by limit() - position()) in the passed IntBuffer into a newly-allocated direct IntBuffer. More... | |
| static ShortBuffer | copyShortBuffer (final ShortBuffer orig) |
Copies the remaining elements (as defined by limit() - position()) in the passed ShortBuffer into a newly-allocated direct ShortBuffer. More... | |
| static ByteBuffer | copyFloatBufferAsByteBuffer (final FloatBuffer orig) |
Copies the remaining elements (as defined by limit() - position()) in the passed FloatBuffer into a newly-allocated direct ByteBuffer. More... | |
| static ByteBuffer | copyIntBufferAsByteBuffer (final IntBuffer orig) |
Copies the remaining elements (as defined by limit() - position()) in the passed IntBuffer into a newly-allocated direct ByteBuffer. More... | |
| static ByteBuffer | copyShortBufferAsByteBuffer (final ShortBuffer orig) |
Copies the remaining elements (as defined by limit() - position()) in the passed ShortBuffer into a newly-allocated direct ByteBuffer. More... | |
| static float[] | getFloatArray (final double[] source, final int soffset, float[] dest, int doffset, int len) |
| static FloatBuffer | getFloatBuffer (final DoubleBuffer source, FloatBuffer dest) |
| No rewind or repositioning is performed. More... | |
| static double[] | getDoubleArray (final float[] source, final int soffset, double[] dest, int doffset, int len) |
| static DoubleBuffer | getDoubleBuffer (final FloatBuffer source, DoubleBuffer dest) |
| No rewind or repositioning is performed. More... | |
| static< B extends Buffer > B | put (final B dest, final Buffer src) |
| static< B extends Buffer > B | putb (final B dest, final byte v) |
| static< B extends Buffer > B | put3b (final B dest, final byte v1, final byte v2, final byte v3) |
| static< B extends Buffer > B | put4b (final B dest, final byte v1, final byte v2, final byte v3, final byte v4) |
| static< B extends Buffer > B | putb (final B dest, final byte[] src, final int offset, final int length) |
| static< B extends Buffer > B | puts (final B dest, final short v) |
| static< B extends Buffer > B | put3s (final B dest, final short v1, final short v2, final short v3) |
| static< B extends Buffer > B | put4s (final B dest, final short v1, final short v2, final short v3, final short v4) |
| static< B extends Buffer > B | puts (final B dest, final short[] src, final int offset, final int length) |
| static< B extends Buffer > B | puti (final B dest, final int v) |
| static< B extends Buffer > B | put3i (final B dest, final int v1, final int v2, final int v3) |
| static< B extends Buffer > B | put4i (final B dest, final int v1, final int v2, final int v3, final int v4) |
| static< B extends Buffer > B | puti (final B dest, final int[] src, final int offset, final int length) |
| static< B extends Buffer > B | putf (final B dest, final float v) |
| static< B extends Buffer > B | put3f (final B dest, final float v1, final float v2, final float v3) |
| static< B extends Buffer > B | put4f (final B dest, final float v1, final float v2, final float v3, final float v4) |
| static< B extends Buffer > B | putf (final B dest, final float[] src, final int offset, final int length) |
| static< B extends Buffer > B | putd (final B dest, final double v) |
| static< B extends Buffer > B | put3d (final B dest, final double v1, final double v2, final double v3) |
| static< B extends Buffer > B | put4d (final B dest, final double v1, final double v2, final double v3, final double v4) |
| static< B extends Buffer > B | putd (final B dest, final double[] src, final int offset, final int length) |
| static< B extends Buffer > B | putNb (final B dest, final boolean dSigned, final byte v, final boolean sSigned) |
| Store byte source value in given buffer after normalizing it to the destination value range considering signed and unsigned source and destination representation. More... | |
| static< B extends Buffer > B | putNs (final B dest, final boolean dSigned, final short v, final boolean sSigned) |
| Store short source value in given buffer after normalizing it to the destination value range considering signed and unsigned source and destination representation. More... | |
| static< B extends Buffer > B | putNi (final B dest, final boolean dSigned, final int v, final boolean sSigned) |
| Store short source value in given buffer after normalizing it to the destination value range considering signed and unsigned source and destination representation. More... | |
| static< B extends Buffer > B | putNf (final B dest, final boolean dSigned, final float v) |
| Store float source value in given buffer after normalizing it to the destination value range considering signed and unsigned destination representation. More... | |
| static void | rangeCheck (final byte[] array, final int offset, final int minElementsRemaining) |
| static void | rangeCheck (final char[] array, final int offset, final int minElementsRemaining) |
| static void | rangeCheck (final short[] array, final int offset, final int minElementsRemaining) |
| static void | rangeCheck (final int[] array, final int offset, final int minElementsRemaining) |
| static void | rangeCheck (final long[] array, final int offset, final int minElementsRemaining) |
| static void | rangeCheck (final float[] array, final int offset, final int minElementsRemaining) |
| static void | rangeCheck (final double[] array, final int offset, final int minElementsRemaining) |
| static void | rangeCheck (final Buffer buffer, final int minElementsRemaining) |
| static void | rangeCheckBytes (final Object buffer, final int minBytesRemaining) throws IllegalArgumentException, IndexOutOfBoundsException |
| static StringBuilder | toString (StringBuilder sb, final String f, final Buffer buffer) |
| Appends Buffer details inclusive data to a StringBuilder instance. More... | |
| static ByteBuffer | copyNativeToDirectByteBuffer (final long source_address, final long len) |
Copy len native bytes @ source_address into a newly created direct ByteBuffer. More... | |
| static int | strnlen (final long cstrptr, final int maxlen) |
Returns strnlen(cstrptr, maxlen) according to POSIX.1-2008. More... | |
Static Public Attributes | |
| static final int | SIZEOF_BYTE = 1 |
| static final int | SIZEOF_SHORT = 2 |
| static final int | SIZEOF_CHAR = 2 |
| static final int | SIZEOF_INT = 4 |
| static final int | SIZEOF_FLOAT = 4 |
| static final int | SIZEOF_LONG = 8 |
| static final int | SIZEOF_DOUBLE = 8 |
Protected Member Functions | |
| Buffers () | |
Utility methods allowing easy java.nio.Buffer manipulations.
Definition at line 70 of file Buffers.java.
|
protected |
Definition at line 85 of file Buffers.java.
|
static |
Copies the remaining elements (as defined by limit() - position()) in the passed ByteBuffer into a newly-allocated direct ByteBuffer.
The returned buffer will have its byte order set to the host platform's native byte order. The position of the newly-allocated buffer will be zero, and the position of the passed buffer is unchanged.
Definition at line 927 of file Buffers.java.
|
static |
Copies the remaining elements (as defined by limit() - position()) in the passed FloatBuffer into a newly-allocated direct FloatBuffer.
The returned buffer will have its byte order set to the host platform's native byte order. The position of the newly-allocated buffer will be zero, and the position of the passed buffer is unchanged.
Definition at line 944 of file Buffers.java.
|
static |
Copies the remaining elements (as defined by limit() - position()) in the passed FloatBuffer into a newly-allocated direct ByteBuffer.
The returned buffer will have its byte order set to the host platform's native byte order. The position of the newly-allocated buffer will be zero, and the position of the passed buffer is unchanged.
Definition at line 983 of file Buffers.java.
|
static |
Copies the remaining elements (as defined by limit() - position()) in the passed IntBuffer into a newly-allocated direct IntBuffer.
The returned buffer will have its byte order set to the host platform's native byte order. The position of the newly-allocated buffer will be zero, and the position of the passed buffer is unchanged.
Definition at line 956 of file Buffers.java.
|
static |
Copies the remaining elements (as defined by limit() - position()) in the passed IntBuffer into a newly-allocated direct ByteBuffer.
The returned buffer will have its byte order set to the host platform's native byte order. The position of the newly-allocated buffer will be zero, and the position of the passed buffer is unchanged.
Definition at line 1000 of file Buffers.java.
|
static |
Copy len native bytes @ source_address into a newly created direct ByteBuffer.
| source_address | memory address of bytes to copy from |
| len | number of bytes to copy |
ByteBuffer holding the copied bytes Definition at line 2070 of file Buffers.java.
|
static |
Copies the remaining elements (as defined by limit() - position()) in the passed ShortBuffer into a newly-allocated direct ShortBuffer.
The returned buffer will have its byte order set to the host platform's native byte order. The position of the newly-allocated buffer will be zero, and the position of the passed buffer is unchanged.
Definition at line 968 of file Buffers.java.
|
static |
Copies the remaining elements (as defined by limit() - position()) in the passed ShortBuffer into a newly-allocated direct ByteBuffer.
The returned buffer will have its byte order set to the host platform's native byte order. The position of the newly-allocated buffer will be zero, and the position of the passed buffer is unchanged.
Definition at line 1017 of file Buffers.java.
|
static |
Helper routine to return the array backing store reference from a Buffer object.
| UnsupportedOperationException | if the passed Object does not have an array backing store |
| IllegalArgumentException | if the passed Object is neither of type java.nio.Buffer or NativeBuffer. |
Definition at line 444 of file Buffers.java.
|
static |
Helper routine to get the Buffer byte offset by taking into account the Buffer position and the underlying type.
This is the total offset for Direct Buffers.
Definition at line 409 of file Buffers.java.
|
static |
| source | the source array |
| soffset | the offset |
| dest | the target array, if null, a new array is being created with size len. |
| doffset | the offset in the dest array |
| len | the payload of elements to be copied, if len < 0 then len = source.length - soffset |
Definition at line 1085 of file Buffers.java.
|
static |
No rewind or repositioning is performed.
| source | the source buffer, which elements from it's current position and it's limit are being copied |
| dest | the target buffer, if null, a new buffer is being created with size source.remaining() |
Definition at line 1111 of file Buffers.java.
|
static |
| source | the source array |
| soffset | the offset |
| dest | the target array, if null, a new array is being created with size len. |
| doffset | the offset in the dest array |
| len | the payload of elements to be copied, if len < 0 then len = source.length - soffset |
Definition at line 1038 of file Buffers.java.
|
static |
No rewind or repositioning is performed.
| source | the source buffer, which elements from it's current position and it's limit are being copied |
| dest | the target buffer, if null, a new buffer is being created with size source.remaining() |
Definition at line 1064 of file Buffers.java.
|
static |
Helper routine to get the full byte offset from the beginning of the array that is the storage for the indirect Buffer object.
The array offset also includes the position offset within the buffer, in addition to any array offset.
Definition at line 463 of file Buffers.java.
|
static |
Helper routine to tell whether a buffer is direct or not.
Null pointers are considered direct.
Definition at line 392 of file Buffers.java.
|
static |
Helper routine to set a ByteBuffer to the native byte order, if that operation is supported by the underlying NIO implementation.
Definition at line 239 of file Buffers.java.
|
static |
|
static |
|
static |
|
static |
Allocates a new direct ByteBuffer with the specified number of elements.
The returned buffer will have its byte order set to the host platform's native byte order.
Definition at line 92 of file Buffers.java.
|
static |
|
static |
|
static |
|
static |
Allocates a new direct CharBuffer with the specified number of elements.
The returned buffer will have its byte order set to the host platform's native byte order.
Definition at line 218 of file Buffers.java.
|
static |
|
static |
|
static |
|
static |
Allocates a new direct DoubleBuffer with the specified number of elements.
The returned buffer will have its byte order set to the host platform's native byte order.
Definition at line 113 of file Buffers.java.
|
static |
|
static |
|
static |
|
static |
Allocates a new direct FloatBuffer with the specified number of elements.
The returned buffer will have its byte order set to the host platform's native byte order.
Definition at line 134 of file Buffers.java.
|
static |
Allocates a new direct IntBuffer with the specified number of elements.
The returned buffer will have its byte order set to the host platform's native byte order.
Definition at line 155 of file Buffers.java.
|
static |
|
static |
|
static |
|
static |
Allocates a new direct LongBuffer with the specified number of elements.
The returned buffer will have its byte order set to the host platform's native byte order.
Definition at line 176 of file Buffers.java.
|
static |
|
static |
|
static |
|
static |
Allocates a new direct ShortBuffer with the specified number of elements.
The returned buffer will have its byte order set to the host platform's native byte order.
Definition at line 197 of file Buffers.java.
|
static |
|
static |
|
static |
|
static |
Definition at line 1130 of file Buffers.java.
|
static |
Definition at line 1171 of file Buffers.java.
|
static |
Definition at line 1639 of file Buffers.java.
|
static |
Definition at line 1573 of file Buffers.java.
|
static |
Definition at line 1465 of file Buffers.java.
|
static |
Definition at line 1338 of file Buffers.java.
|
static |
Definition at line 1220 of file Buffers.java.
|
static |
Definition at line 1658 of file Buffers.java.
|
static |
Definition at line 1592 of file Buffers.java.
|
static |
Definition at line 1496 of file Buffers.java.
|
static |
Definition at line 1375 of file Buffers.java.
|
static |
Definition at line 1150 of file Buffers.java.
|
static |
Definition at line 1276 of file Buffers.java.
|
static |
Definition at line 1628 of file Buffers.java.
|
static |
Definition at line 1679 of file Buffers.java.
|
static |
Definition at line 1558 of file Buffers.java.
|
static |
Definition at line 1613 of file Buffers.java.
|
static |
Definition at line 1450 of file Buffers.java.
|
static |
Definition at line 1531 of file Buffers.java.
|
static |
Store byte source value in given buffer after normalizing it to the destination value range considering signed and unsigned source and destination representation.
| dest | One of ByteBuffer, ShortBuffer, IntBuffer, FloatBuffer |
| dSigned | true if destination buffer holds signed values, false if destination buffer holds unsigned values |
| v | source byte value to be put in dest buffer |
| sSigned | true if source represents a signed value, false if source represents an unsigned value |
Definition at line 1707 of file Buffers.java.
|
static |
Store float source value in given buffer after normalizing it to the destination value range considering signed and unsigned destination representation.
| dest | One of ByteBuffer, ShortBuffer, IntBuffer, FloatBuffer |
| dSigned | true if destination buffer holds signed values, false if destination buffer holds unsigned values |
| v | source float value to be put in dest buffer |
Definition at line 1778 of file Buffers.java.
|
static |
Store short source value in given buffer after normalizing it to the destination value range considering signed and unsigned source and destination representation.
| dest | One of ByteBuffer, ShortBuffer, IntBuffer, FloatBuffer |
| dSigned | true if destination buffer holds signed values, false if destination buffer holds unsigned values |
| v | source short value to be put in dest buffer |
| sSigned | true if source represents a signed value, false if source represents an unsigned value |
Definition at line 1755 of file Buffers.java.
|
static |
Store short source value in given buffer after normalizing it to the destination value range considering signed and unsigned source and destination representation.
| dest | One of ByteBuffer, ShortBuffer, IntBuffer, FloatBuffer |
| dSigned | true if destination buffer holds signed values, false if destination buffer holds unsigned values |
| v | source short value to be put in dest buffer |
| sSigned | true if source represents a signed value, false if source represents an unsigned value |
Definition at line 1731 of file Buffers.java.
|
static |
Definition at line 1321 of file Buffers.java.
|
static |
Definition at line 1417 of file Buffers.java.
|
static |
Definition at line 1866 of file Buffers.java.
|
static |
Definition at line 1796 of file Buffers.java.
|
static |
Definition at line 1806 of file Buffers.java.
|
static |
Definition at line 1856 of file Buffers.java.
|
static |
Definition at line 1846 of file Buffers.java.
|
static |
Definition at line 1826 of file Buffers.java.
|
static |
Definition at line 1836 of file Buffers.java.
|
static |
Definition at line 1816 of file Buffers.java.
|
static |
| buffer | buffer to test for minimum |
| minBytesRemaining | minimum bytes remaining |
| IllegalArgumentException | if buffer is of invalid type. |
| IndexOutOfBoundsException | if remainingBytes(Object) is < minBytesRemaining |
Definition at line 1882 of file Buffers.java.
|
static |
Returns the number of remaining bytes of the given anonymous buffer.
| buffer | Anonymous Buffer of type NativeBuffer or a derivation of Buffer. |
buffer is null, returns 0, otherwise the remaining size in bytes. | IllegalArgumentException | |
Definition at line 355 of file Buffers.java.
|
static |
Returns the number of remaining elements of the given anonymous buffer.
| buffer | Anonymous Buffer of type NativeBuffer or a derivation of Buffer. |
buffer is null, returns 0, otherwise the remaining size in elements. | IllegalArgumentException | |
Definition at line 335 of file Buffers.java.
|
static |
Returns the size of a single element of the given buffer class in bytes or 0 if the given buffer is null.
Definition at line 277 of file Buffers.java.
|
static |
Returns the size of a single element of the given buffer in bytes or 0 if the given buffer is null.
Definition at line 304 of file Buffers.java.
|
static |
Calls slice on the specified buffer while maintaining the byteorder.
Definition at line 501 of file Buffers.java.
|
static |
Slices the specified buffer with offset as position and offset+size as limit while maintaining the byteorder.
Concurrency warning: this method changes the buffers position and limit but will restore it before return.
Definition at line 527 of file Buffers.java.
|
static |
Slices a ByteBuffer or a CharBuffer to a CharBuffer at the given elementStartPos with the given elementCount in short-space.
The returned sliced buffer's start position is zero.
See slice2Float(Buffer, int, int) for details.
| buf | source Buffer, maybe ByteBuffer (recommended) or CharBuffer. Buffer's position is ignored and elementStartPos is being used. |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_CHAR |
| elementCount | element count for element of size Buffers#SIZEOF_CHAR |
Definition at line 694 of file Buffers.java.
|
static |
Slices a primitive float backing array to a CharBuffer at the given elementStartPos with the given elementCount in short-space by wrapping the backing array.
See slice2Float(float[], int, int) for details.
| backing | source float array |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_CHAR |
| elementCount | element count for element of size Buffers#SIZEOF_CHAR |
Definition at line 733 of file Buffers.java.
|
static |
Slices a ByteBuffer or a DoubleBuffer to a DoubleBuffer at the given elementStartPos with the given elementCount in double-space.
The returned sliced buffer's start position is zero.
See slice2Float(Buffer, int, int) for details.
| buf | source Buffer, maybe ByteBuffer (recommended) or DoubleBuffer. Buffer's position is ignored and elementStartPos is being used. |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_DOUBLE |
| elementCount | element count for element of size Buffers#SIZEOF_DOUBLE |
Definition at line 874 of file Buffers.java.
|
static |
Slices a primitive float backing array to a DoubleBuffer at the given elementStartPos with the given elementCount in double-space by wrapping the backing array.
See slice2Float(float[], int, int) for details.
| backing | source float array |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_DOUBLE |
| elementCount | element count for element of size Buffers#SIZEOF_DOUBLE |
Definition at line 913 of file Buffers.java.
|
static |
Slices a ByteBuffer or a FloatBuffer to a FloatBuffer at the given elementStartPos with the given elementCount in float-space.
The returned sliced buffer's start position is zero.
The returned sliced buffer is marked at it's start position. Hence FloatBuffer#reset() will rewind it to start after applying relative operations like FloatBuffer#get().
Using a ByteBuffer as the source guarantees keeping the source native order programmatically. This works around Honeycomb / Android 3.0 Issue 16434. This bug is resolved at least in Android 3.2.
| buf | source Buffer, maybe ByteBuffer (recommended) or FloatBuffer. Buffer's position is ignored and elementStartPos is being used. |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_FLOAT |
| elementCount | element count for element of size Buffers#SIZEOF_FLOAT |
Definition at line 565 of file Buffers.java.
|
static |
Slices a primitive float backing array to a FloatBuffer at the given elementStartPos with the given elementCount in float-space by wrapping the backing array.
Due to wrapping the backing array, the returned sliced buffer's start position equals the given floatStartPos within the given backing array while it's array-offset is zero. This has the advantage of being able to dismiss the array-offset in user code, while only being required to consider it's position.
The returned sliced buffer is marked at it's start position. Hence FloatBuffer#reset() will rewind it to start after applying relative operations like FloatBuffer#get().
| backing | source float array |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_FLOAT |
| elementCount | element count for element of size Buffers#SIZEOF_FLOAT |
Definition at line 613 of file Buffers.java.
|
static |
Slices a ByteBuffer or a IntBuffer to a IntBuffer at the given elementStartPos with the given elementCount in int-space.
The returned sliced buffer's start position is zero.
See slice2Float(Buffer, int, int) for details.
| buf | source Buffer, maybe ByteBuffer (recommended) or IntBuffer. Buffer's position is ignored and elementStartPos is being used. |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_INT |
| elementCount | element count for element of size Buffers#SIZEOF_INT |
Definition at line 754 of file Buffers.java.
|
static |
Slices a primitive float backing array to a IntBuffer at the given elementStartPos with the given elementCount in int-space by wrapping the backing array.
See slice2Float(float[], int, int) for details.
| backing | source float array |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_INT |
| elementCount | element count for element of size Buffers#SIZEOF_INT |
Definition at line 793 of file Buffers.java.
|
static |
Slices a ByteBuffer or a LongBuffer to a LongBuffer at the given elementStartPos with the given elementCount in long-space.
The returned sliced buffer's start position is zero.
See slice2Float(Buffer, int, int) for details.
| buf | source Buffer, maybe ByteBuffer (recommended) or LongBuffer. Buffer's position is ignored and elementStartPos is being used. |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_LONG |
| elementCount | element count for element of size Buffers#SIZEOF_LONG |
Definition at line 814 of file Buffers.java.
|
static |
Slices a primitive float backing array to a LongBuffer at the given elementStartPos with the given elementCount in long-space by wrapping the backing array.
See slice2Float(float[], int, int) for details.
| backing | source float array |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_LONG |
| elementCount | element count for element of size Buffers#SIZEOF_LONG |
Definition at line 853 of file Buffers.java.
|
static |
Slices a ByteBuffer or a ShortBuffer to a ShortBuffer at the given elementStartPos with the given elementCount in short-space.
The returned sliced buffer's start position is zero.
See slice2Float(Buffer, int, int) for details.
| buf | source Buffer, maybe ByteBuffer (recommended) or ShortBuffer. Buffer's position is ignored and elementStartPos is being used. |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_SHORT |
| elementCount | element count for element of size Buffers#SIZEOF_SHORT |
Definition at line 634 of file Buffers.java.
|
static |
Slices a primitive float backing array to a ShortBuffer at the given elementStartPos with the given elementCount in short-space by wrapping the backing array.
See slice2Float(float[], int, int) for details.
| backing | source float array |
| elementStartPos | element start position w/ element of size Buffers#SIZEOF_SHORT |
| elementCount | element count for element of size Buffers#SIZEOF_SHORT |
Definition at line 673 of file Buffers.java.
|
static |
Returns strnlen(cstrptr, maxlen) according to POSIX.1-2008.
The strnlen() function returns the number of bytes in the string pointed to by cstrptr, excluding the terminating null byte ('\0'), but at most maxlen. In doing this, strnlen() looks only at the first maxlen characters in the string pointed to by cstrptr and never beyond cstrptr[maxlen-1].
Definition at line 2111 of file Buffers.java.
|
static |
Appends Buffer details inclusive data to a StringBuilder instance.
| sb | optional pass through StringBuilder |
| f | optional format string of one element, i.e. "%10.5f" for FloatBuffer, see java.util.Formatter, or null for unformatted output. Note: Caller is responsible to match the format string w/ the data type as expected in the given buffer. |
| buffer | Any valid Buffer instance |
Definition at line 1901 of file Buffers.java.
|
static |
Returns Buffer class matching the given lower case typeName
| typeName | lower-case type name |
Buffer class or null Definition at line 249 of file Buffers.java.
|
static |
Definition at line 77 of file Buffers.java.
|
static |
Definition at line 79 of file Buffers.java.
|
static |
Definition at line 83 of file Buffers.java.
|
static |
Definition at line 81 of file Buffers.java.
|
static |
Definition at line 80 of file Buffers.java.
|
static |
Definition at line 82 of file Buffers.java.
|
static |
Definition at line 78 of file Buffers.java.