final class ObjectBuffer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static int |
ARRAY |
(package private) static int |
BOOLEAN |
(package private) static int |
BUFFER |
(package private) static int |
BYTE |
(package private) static int |
CHAR |
static int |
CLEAR
For OUT arrays, clear the temporary native memory area
|
(package private) static int |
DOUBLE |
(package private) static int |
FLAGS_MASK |
(package private) static int |
FLAGS_SHIFT |
(package private) static int |
FLOAT |
static int |
IN
Copy the array contents to native memory before calling the function
|
(package private) static int |
INDEX_MASK |
(package private) static int |
INDEX_SHIFT |
private int[] |
info
The flags/offset/length descriptor array.
|
private int |
infoIndex
The index of the next descriptor storage slot
|
(package private) static int |
INT |
(package private) static int |
JNI |
static int |
JNIENV
The JNIEnv address
|
static int |
JNIOBJECT
The jobject handle
|
(package private) static int |
LONG |
private int |
objectIndex
The index of the next object storage slot
|
private java.lang.Object[] |
objects
The objects stored in this buffer
|
static int |
OUT
After calling the function, reload the array contents from native memory
|
static int |
PINNED
Pin the array memory and pass the JVM memory pointer directly to the function
|
(package private) static int |
PRIM_MASK |
(package private) static int |
SHORT |
(package private) static int |
TYPE_MASK |
(package private) static int |
TYPE_SHIFT |
static int |
ZERO_TERMINATE
Append a NUL byte to the array contents after copying to native memory
|
Constructor and Description |
---|
ObjectBuffer() |
ObjectBuffer(int objectCount) |
Modifier and Type | Method and Description |
---|---|
private void |
ensureSpace()
Ensures that sufficient space is available to insert at least one more object
|
(package private) int[] |
info()
Gets the object descriptor array.
|
(package private) static int |
makeBufferFlags(int index)
Encodes the native object flags for an NIO Buffer.
|
private static int |
makeJNIFlags(int index,
int type) |
(package private) static int |
makeObjectFlags(int ioflags,
int type,
int index)
Encodes the native object flags for an array.
|
(package private) int |
objectCount()
Gets the number of objects stored in this ObjectBuffer.
|
(package private) java.lang.Object[] |
objects()
Gets the array of stored objects.
|
void |
putArray(int index,
boolean[] array,
int offset,
int length,
int flags)
Adds a java boolean array as a pointer parameter.
|
void |
putArray(int index,
byte[] array,
int offset,
int length,
int flags)
Adds a java byte array as a pointer parameter.
|
void |
putArray(int index,
char[] array,
int offset,
int length,
int flags)
Adds a java char array as a pointer parameter.
|
void |
putArray(int index,
double[] array,
int offset,
int length,
int flags)
Adds a java double array as a pointer parameter.
|
void |
putArray(int index,
float[] array,
int offset,
int length,
int flags)
Adds a java float array as a pointer parameter.
|
void |
putArray(int index,
int[] array,
int offset,
int length,
int flags)
Adds a java int array as a pointer parameter.
|
void |
putArray(int index,
long[] array,
int offset,
int length,
int flags)
Adds a java long array as a pointer parameter.
|
void |
putArray(int index,
short[] array,
int offset,
int length,
int flags)
Adds a java short array as a pointer parameter.
|
void |
putDirectBuffer(int index,
java.nio.Buffer obj,
int offset,
int length)
Adds a java direct buffer as a pointer parameter.
|
void |
putJNI(int index,
java.lang.Object obj,
int type)
Put the address of the current JNIEnv into this parameter position
|
(package private) void |
putObject(java.lang.Object array,
int offset,
int length,
int flags) |
public static final int IN
public static final int OUT
public static final int ZERO_TERMINATE
public static final int PINNED
public static final int CLEAR
static final int INDEX_SHIFT
static final int INDEX_MASK
static final int TYPE_SHIFT
static final int TYPE_MASK
static final int PRIM_MASK
static final int FLAGS_SHIFT
static final int FLAGS_MASK
static final int ARRAY
static final int BUFFER
static final int JNI
static final int BYTE
static final int SHORT
static final int INT
static final int LONG
static final int FLOAT
static final int DOUBLE
static final int BOOLEAN
static final int CHAR
public static final int JNIENV
public static final int JNIOBJECT
private java.lang.Object[] objects
private int[] info
private int infoIndex
private int objectIndex
final int objectCount()
final int[] info()
final java.lang.Object[] objects()
private final void ensureSpace()
static final int makeObjectFlags(int ioflags, int type, int index)
ioflags
- The array flags (IN, OUT) for the object.type
- The type of the object.index
- The parameter index the object should be passed as.static final int makeBufferFlags(int index)
index
- The parameter index of the buffer.private static final int makeJNIFlags(int index, int type)
public void putArray(int index, byte[] array, int offset, int length, int flags)
array
- The java array to use as the pointer parameter.offset
- The offset from the start of the array.length
- The length of the array to use.flags
- The flags to use (IN, OUT, NULTERMINATE)public void putArray(int index, short[] array, int offset, int length, int flags)
array
- The java array to use as the pointer parameter.offset
- The offset from the start of the array.length
- The length of the array to use.flags
- The flags to use (IN, OUT)public void putArray(int index, int[] array, int offset, int length, int flags)
array
- The java array to use as the pointer parameter.offset
- The offset from the start of the array.length
- The length of the array to use.flags
- The flags to use (IN, OUT)public void putArray(int index, long[] array, int offset, int length, int flags)
array
- The java array to use as the pointer parameter.offset
- The offset from the start of the array.length
- The length of the array to use.flags
- The flags to use (IN, OUT)public void putArray(int index, float[] array, int offset, int length, int flags)
array
- The java array to use as the pointer parameter.offset
- The offset from the start of the array.length
- The length of the array to use.flags
- The flags to use (IN, OUT)public void putArray(int index, double[] array, int offset, int length, int flags)
array
- The java array to use as the pointer parameter.offset
- The offset from the start of the array.length
- The length of the array to use.flags
- The flags to use (IN, OUT)public void putArray(int index, boolean[] array, int offset, int length, int flags)
array
- The java array to use as the pointer parameter.offset
- The offset from the start of the array.length
- The length of the array to use.flags
- The flags to use (IN, OUT)public void putArray(int index, char[] array, int offset, int length, int flags)
array
- The java array to use as the pointer parameter.offset
- The offset from the start of the array.length
- The length of the array to use.flags
- The flags to use (IN, OUT)public void putDirectBuffer(int index, java.nio.Buffer obj, int offset, int length)
buffer
- The buffer to use as a pointer argument.offset
- An offset to add to the buffer native address.length
- The length of the buffer to use.public void putJNI(int index, java.lang.Object obj, int type)
index
- The index of the parameter.void putObject(java.lang.Object array, int offset, int length, int flags)