newDirectByteBuffer
fun newDirectByteBuffer(address: COpaquePointer, capacity: Long): JByteBuffer?(source)
Allocates and returns a direct java.nio.ByteBuffer referring to the block of memory starting at the memory address address and extending capacity bytes. The byte order of the returned buffer is always big-endian (high byte first; java.nio.ByteOrder.BIG_ENDIAN).
Native code that calls this function and returns the resulting byte-buffer object to Java-level code should ensure that the buffer refers to a valid region of memory that is accessible for reading and, if appropriate, writing. An attempt to access an invalid memory location from Java code will either return an arbitrary value, have no visible effect or cause an unspecified exception to be thrown.
Return
a local reference to the newly instantiated java.nio.ByteBuffer object. Returns null if an exception occurs, or if this virtual machine does not support JNI access to direct buffers.
Since
JDK/JRE 1.4
Parameters
the starting address of the memory region.
the size in bytes of the memory region; must be positive.
Throws
if allocation of the ByteBuffer object fails.