jaulib v1.3.0
Jau Support Library (C++, Java, ..)
|
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 size) |
Allocates a new direct ByteBuffer with the specified number of elements. More... | |
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 boolean | isDirect (final Object buf) |
Helper routine to tell whether a buffer is direct or not. More... | |
static long | 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 long | getDirectBufferByteLimit (final Object buf) |
Helper routine to get the Buffer byte limit by taking into account the Buffer limit and the underlying type. 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 |
Utility methods allowing easy java.nio.Buffer
manipulations.
Definition at line 43 of file Buffers.java.
|
static |
Helper routine to get the Buffer byte limit by taking into account the Buffer limit and the underlying type.
This is the total limit for Direct Buffers.
Return value is of type long
only to cover the int
multiple of the position and element type size.
For ByteBuffer, the return value can be safely cast to int
.
Definition at line 129 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.
Return value is of type long
only to cover the int
multiple of the position and element type size.
For ByteBuffer, the return value can be safely cast to int
.
Definition at line 96 of file Buffers.java.
|
static |
Helper routine to tell whether a buffer is direct or not.
Null pointers are considered direct.
Definition at line 78 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 70 of file Buffers.java.
|
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 61 of file Buffers.java.
|
static |
Definition at line 46 of file Buffers.java.
|
static |
Definition at line 48 of file Buffers.java.
|
static |
Definition at line 52 of file Buffers.java.
|
static |
Definition at line 50 of file Buffers.java.
|
static |
Definition at line 49 of file Buffers.java.
|
static |
Definition at line 51 of file Buffers.java.
|
static |
Definition at line 47 of file Buffers.java.