Class JNINativeInterface


  • public class JNINativeInterface
    extends java.lang.Object
    Bindings to the Java Native Interface (JNI).

    The JNI is a native programming interface. It allows Java code that runs inside a Java Virtual Machine (VM) to interoperate with applications and libraries written in other programming languages, such as C, C++, and assembly.

    The most important benefit of the JNI is that it imposes no restrictions on the implementation of the underlying Java VM. Therefore, Java VM vendors can add support for the JNI without affecting other parts of the VM. Programmers can write one version of a native application or library and expect it to work with all Java VMs supporting the JNI.

    LWJGL: Only functions that can reasonably be called from Java are exposed.

    • Method Detail

      • GetVersion

        public static int GetVersion()
        Returns the version of the native method interface.
        Returns:
        the major version number in the higher 16 bits and the minor version number in the lower 16 bits
      • FromReflectedMethod

        public static long FromReflectedMethod​(java.lang.reflect.Method method)
        Converts a Method or Constructor object to a method ID.
      • FromReflectedField

        public static long FromReflectedField​(java.lang.reflect.Field field)
        Converts a Field to a field ID.
      • ToReflectedMethod

        @Nullable
        public static java.lang.reflect.Method ToReflectedMethod​(java.lang.Class<?> cls,
                                                                 long methodID,
                                                                 boolean isStatic)
        Converts a method ID derived from cls to a Method or Constructor object.
        Parameters:
        isStatic - must be set to TRUE if the method ID refers to a static field, and # FALSE otherwise
      • ToReflectedField

        @Nullable
        public static java.lang.reflect.Field ToReflectedField​(java.lang.Class<?> cls,
                                                               long fieldID,
                                                               boolean isStatic)
        Converts a field ID derived from cls to a Field object.
        Parameters:
        isStatic - must be set to TRUE if fieldID refers to a static field, and FALSE otherwise
      • NewGlobalRef

        public static long NewGlobalRef​(java.lang.Object obj)
        Creates a new global reference to the object referred to by the obj argument. The obj argument may be a global or local reference. Global references must be explicitly disposed of by calling DeleteGlobalRef(long).
        Parameters:
        obj - a global or local reference
        Returns:
        a global reference, or NULL if the system runs out of memory
      • nDeleteGlobalRef

        public static void nDeleteGlobalRef​(long globalRef)
        Unsafe version of: DeleteGlobalRef(long)
      • DeleteGlobalRef

        public static void DeleteGlobalRef​(long globalRef)
        Deletes the global reference pointed to by globalRef.
        Parameters:
        globalRef - a global reference
      • GetBooleanArrayElements

        @Nullable
        public static java.nio.ByteBuffer GetBooleanArrayElements​(byte[] array,
                                                                  @Nullable
                                                                  java.nio.ByteBuffer isCopy)
        Returns the body of the primitive array. The result is valid until the ReleaseBooleanArrayElements(byte[], java.nio.ByteBuffer, int) function is called. Since the returned array may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until ReleaseBooleanArrayElements(byte[], java.nio.ByteBuffer, int) is called.

        If isCopy is not NULL, then *isCopy is set to TRUE if a copy is made; or it is set to FALSE if no copy is made.

        Parameters:
        array - the primitive array
        isCopy - a pointer to a boolean
        Returns:
        a pointer to the array elements, or NULL if the operation fails
      • ReleaseBooleanArrayElements

        public static void ReleaseBooleanArrayElements​(byte[] array,
                                                       java.nio.ByteBuffer elems,
                                                       int mode)
        Informs the VM that the native code no longer needs access to elems. The elems argument is a pointer derived from array using the GetBooleanArrayElements(byte[], java.nio.ByteBuffer) function. If necessary, this function copies back all changes made to elems to the original array.

        The mode argument provides information on how the array buffer should be released. mode has no effect if elems is not a copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

        modeactions
        0copy back the content and free the elems buffer
        COMMITcopy back the content but do not free the elems buffer
        ABORTfree the buffer without copying back the possible changes

        In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give the programmer more control over memory management and should be used with extreme care.

        Parameters:
        array - a Java array object
        elems - a pointer to array elements
        mode - the release mode. One of:
        0COMMITABORT
      • GetByteArrayElements

        @Nullable
        public static java.nio.ByteBuffer GetByteArrayElements​(byte[] array,
                                                               @Nullable
                                                               java.nio.ByteBuffer isCopy)
        Returns the body of the primitive array. The result is valid until the ReleaseByteArrayElements(byte[], java.nio.ByteBuffer, int) function is called. Since the returned array may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until ReleaseByteArrayElements(byte[], java.nio.ByteBuffer, int) is called.

        If isCopy is not NULL, then *isCopy is set to TRUE if a copy is made; or it is set to FALSE if no copy is made.

        Parameters:
        array - the primitive array
        isCopy - a pointer to a boolean
        Returns:
        a pointer to the array elements, or NULL if the operation fails
      • ReleaseByteArrayElements

        public static void ReleaseByteArrayElements​(byte[] array,
                                                    java.nio.ByteBuffer elems,
                                                    int mode)
        Informs the VM that the native code no longer needs access to elems. The elems argument is a pointer derived from array using the GetByteArrayElements(byte[], java.nio.ByteBuffer) function. If necessary, this function copies back all changes made to elems to the original array.

        The mode argument provides information on how the array buffer should be released. mode has no effect if elems is not a copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

        modeactions
        0copy back the content and free the elems buffer
        COMMITcopy back the content but do not free the elems buffer
        ABORTfree the buffer without copying back the possible changes

        In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give the programmer more control over memory management and should be used with extreme care.

        Parameters:
        array - a Java array object
        elems - a pointer to array elements
        mode - the release mode. One of:
        0COMMITABORT
      • GetCharArrayElements

        @Nullable
        public static java.nio.ShortBuffer GetCharArrayElements​(char[] array,
                                                                @Nullable
                                                                java.nio.ByteBuffer isCopy)
        Returns the body of the primitive array. The result is valid until the ReleaseCharArrayElements(char[], java.nio.ShortBuffer, int) function is called. Since the returned array may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until ReleaseCharArrayElements(char[], java.nio.ShortBuffer, int) is called.

        If isCopy is not NULL, then *isCopy is set to TRUE if a copy is made; or it is set to FALSE if no copy is made.

        Parameters:
        array - the primitive array
        isCopy - a pointer to a boolean
        Returns:
        a pointer to the array elements, or NULL if the operation fails
      • ReleaseCharArrayElements

        public static void ReleaseCharArrayElements​(char[] array,
                                                    java.nio.ShortBuffer elems,
                                                    int mode)
        Informs the VM that the native code no longer needs access to elems. The elems argument is a pointer derived from array using the GetCharArrayElements(char[], java.nio.ByteBuffer) function. If necessary, this function copies back all changes made to elems to the original array.

        The mode argument provides information on how the array buffer should be released. mode has no effect if elems is not a copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

        modeactions
        0copy back the content and free the elems buffer
        COMMITcopy back the content but do not free the elems buffer
        ABORTfree the buffer without copying back the possible changes

        In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give the programmer more control over memory management and should be used with extreme care.

        Parameters:
        array - a Java array object
        elems - a pointer to array elements
        mode - the release mode. One of:
        0COMMITABORT
      • GetShortArrayElements

        @Nullable
        public static java.nio.ShortBuffer GetShortArrayElements​(short[] array,
                                                                 @Nullable
                                                                 java.nio.ByteBuffer isCopy)
        Returns the body of the primitive array. The result is valid until the ReleaseShortArrayElements(short[], java.nio.ShortBuffer, int) function is called. Since the returned array may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until ReleaseShortArrayElements(short[], java.nio.ShortBuffer, int) is called.

        If isCopy is not NULL, then *isCopy is set to TRUE if a copy is made; or it is set to FALSE if no copy is made.

        Parameters:
        array - the primitive array
        isCopy - a pointer to a boolean
        Returns:
        a pointer to the array elements, or NULL if the operation fails
      • ReleaseShortArrayElements

        public static void ReleaseShortArrayElements​(short[] array,
                                                     java.nio.ShortBuffer elems,
                                                     int mode)
        Informs the VM that the native code no longer needs access to elems. The elems argument is a pointer derived from array using the GetShortArrayElements(short[], java.nio.ByteBuffer) function. If necessary, this function copies back all changes made to elems to the original array.

        The mode argument provides information on how the array buffer should be released. mode has no effect if elems is not a copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

        modeactions
        0copy back the content and free the elems buffer
        COMMITcopy back the content but do not free the elems buffer
        ABORTfree the buffer without copying back the possible changes

        In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give the programmer more control over memory management and should be used with extreme care.

        Parameters:
        array - a Java array object
        elems - a pointer to array elements
        mode - the release mode. One of:
        0COMMITABORT
      • GetIntArrayElements

        @Nullable
        public static java.nio.IntBuffer GetIntArrayElements​(int[] array,
                                                             @Nullable
                                                             java.nio.ByteBuffer isCopy)
        Returns the body of the primitive array. The result is valid until the ReleaseIntArrayElements(int[], java.nio.IntBuffer, int) function is called. Since the returned array may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until ReleaseIntArrayElements(int[], java.nio.IntBuffer, int) is called.

        If isCopy is not NULL, then *isCopy is set to TRUE if a copy is made; or it is set to FALSE if no copy is made.

        Parameters:
        array - the primitive array
        isCopy - a pointer to a boolean
        Returns:
        a pointer to the array elements, or NULL if the operation fails
      • ReleaseIntArrayElements

        public static void ReleaseIntArrayElements​(int[] array,
                                                   java.nio.IntBuffer elems,
                                                   int mode)
        Informs the VM that the native code no longer needs access to elems. The elems argument is a pointer derived from array using the GetIntArrayElements(int[], java.nio.ByteBuffer) function. If necessary, this function copies back all changes made to elems to the original array.

        The mode argument provides information on how the array buffer should be released. mode has no effect if elems is not a copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

        modeactions
        0copy back the content and free the elems buffer
        COMMITcopy back the content but do not free the elems buffer
        ABORTfree the buffer without copying back the possible changes

        In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give the programmer more control over memory management and should be used with extreme care.

        Parameters:
        array - a Java array object
        elems - a pointer to array elements
        mode - the release mode. One of:
        0COMMITABORT
      • GetLongArrayElements

        @Nullable
        public static java.nio.LongBuffer GetLongArrayElements​(long[] array,
                                                               @Nullable
                                                               java.nio.ByteBuffer isCopy)
        Returns the body of the primitive array. The result is valid until the ReleaseLongArrayElements(long[], java.nio.LongBuffer, int) function is called. Since the returned array may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until ReleaseLongArrayElements(long[], java.nio.LongBuffer, int) is called.

        If isCopy is not NULL, then *isCopy is set to TRUE if a copy is made; or it is set to FALSE if no copy is made.

        Parameters:
        array - the primitive array
        isCopy - a pointer to a boolean
        Returns:
        a pointer to the array elements, or NULL if the operation fails
      • ReleaseLongArrayElements

        public static void ReleaseLongArrayElements​(long[] array,
                                                    java.nio.LongBuffer elems,
                                                    int mode)
        Informs the VM that the native code no longer needs access to elems. The elems argument is a pointer derived from array using the GetLongArrayElements(long[], java.nio.ByteBuffer) function. If necessary, this function copies back all changes made to elems to the original array.

        The mode argument provides information on how the array buffer should be released. mode has no effect if elems is not a copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

        modeactions
        0copy back the content and free the elems buffer
        COMMITcopy back the content but do not free the elems buffer
        ABORTfree the buffer without copying back the possible changes

        In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give the programmer more control over memory management and should be used with extreme care.

        Parameters:
        array - a Java array object
        elems - a pointer to array elements
        mode - the release mode. One of:
        0COMMITABORT
      • GetFloatArrayElements

        @Nullable
        public static java.nio.FloatBuffer GetFloatArrayElements​(float[] array,
                                                                 @Nullable
                                                                 java.nio.ByteBuffer isCopy)
        Returns the body of the primitive array. The result is valid until the ReleaseFloatArrayElements(float[], java.nio.FloatBuffer, int) function is called. Since the returned array may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until ReleaseFloatArrayElements(float[], java.nio.FloatBuffer, int) is called.

        If isCopy is not NULL, then *isCopy is set to TRUE if a copy is made; or it is set to FALSE if no copy is made.

        Parameters:
        array - the primitive array
        isCopy - a pointer to a boolean
        Returns:
        a pointer to the array elements, or NULL if the operation fails
      • ReleaseFloatArrayElements

        public static void ReleaseFloatArrayElements​(float[] array,
                                                     java.nio.FloatBuffer elems,
                                                     int mode)
        Informs the VM that the native code no longer needs access to elems. The elems argument is a pointer derived from array using the GetFloatArrayElements(float[], java.nio.ByteBuffer) function. If necessary, this function copies back all changes made to elems to the original array.

        The mode argument provides information on how the array buffer should be released. mode has no effect if elems is not a copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

        modeactions
        0copy back the content and free the elems buffer
        COMMITcopy back the content but do not free the elems buffer
        ABORTfree the buffer without copying back the possible changes

        In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give the programmer more control over memory management and should be used with extreme care.

        Parameters:
        array - a Java array object
        elems - a pointer to array elements
        mode - the release mode. One of:
        0COMMITABORT
      • GetDoubleArrayElements

        @Nullable
        public static java.nio.DoubleBuffer GetDoubleArrayElements​(double[] array,
                                                                   @Nullable
                                                                   java.nio.ByteBuffer isCopy)
        Returns the body of the primitive array. The result is valid until the ReleaseDoubleArrayElements(double[], java.nio.DoubleBuffer, int) function is called. Since the returned array may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until ReleaseDoubleArrayElements(double[], java.nio.DoubleBuffer, int) is called.

        If isCopy is not NULL, then *isCopy is set to TRUE if a copy is made; or it is set to FALSE if no copy is made.

        Parameters:
        array - the primitive array
        isCopy - a pointer to a boolean
        Returns:
        a pointer to the array elements, or NULL if the operation fails
      • ReleaseDoubleArrayElements

        public static void ReleaseDoubleArrayElements​(double[] array,
                                                      java.nio.DoubleBuffer elems,
                                                      int mode)
        Informs the VM that the native code no longer needs access to elems. The elems argument is a pointer derived from array using the GetDoubleArrayElements(double[], java.nio.ByteBuffer) function. If necessary, this function copies back all changes made to elems to the original array.

        The mode argument provides information on how the array buffer should be released. mode has no effect if elems is not a copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

        modeactions
        0copy back the content and free the elems buffer
        COMMITcopy back the content but do not free the elems buffer
        ABORTfree the buffer without copying back the possible changes

        In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give the programmer more control over memory management and should be used with extreme care.

        Parameters:
        array - a Java array object
        elems - a pointer to array elements
        mode - the release mode. One of:
        0COMMITABORT
      • GetBooleanArrayRegion

        public static void GetBooleanArrayRegion​(byte[] array,
                                                 int start,
                                                 java.nio.ByteBuffer buf)
        Copies a region of a primitive array into a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the destination buffer
      • SetBooleanArrayRegion

        public static void SetBooleanArrayRegion​(byte[] array,
                                                 int start,
                                                 java.nio.ByteBuffer buf)
        Copies back a region of a primitive array from a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the source buffer
      • GetByteArrayRegion

        public static void GetByteArrayRegion​(byte[] array,
                                              int start,
                                              java.nio.ByteBuffer buf)
        Copies a region of a primitive array into a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the destination buffer
      • SetByteArrayRegion

        public static void SetByteArrayRegion​(byte[] array,
                                              int start,
                                              java.nio.ByteBuffer buf)
        Copies back a region of a primitive array from a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the source buffer
      • GetCharArrayRegion

        public static void GetCharArrayRegion​(char[] array,
                                              int start,
                                              java.nio.ShortBuffer buf)
        Copies a region of a primitive array into a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the destination buffer
      • SetCharArrayRegion

        public static void SetCharArrayRegion​(char[] array,
                                              int start,
                                              java.nio.ShortBuffer buf)
        Copies back a region of a primitive array from a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the source buffer
      • GetShortArrayRegion

        public static void GetShortArrayRegion​(short[] array,
                                               int start,
                                               java.nio.ShortBuffer buf)
        Copies a region of a primitive array into a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the destination buffer
      • SetShortArrayRegion

        public static void SetShortArrayRegion​(short[] array,
                                               int start,
                                               java.nio.ShortBuffer buf)
        Copies back a region of a primitive array from a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the source buffer
      • GetIntArrayRegion

        public static void GetIntArrayRegion​(int[] array,
                                             int start,
                                             java.nio.IntBuffer buf)
        Copies a region of a primitive array into a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the destination buffer
      • SetIntArrayRegion

        public static void SetIntArrayRegion​(int[] array,
                                             int start,
                                             java.nio.IntBuffer buf)
        Copies back a region of a primitive array from a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the source buffer
      • GetLongArrayRegion

        public static void GetLongArrayRegion​(long[] array,
                                              int start,
                                              java.nio.LongBuffer buf)
        Copies a region of a primitive array into a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the destination buffer
      • SetLongArrayRegion

        public static void SetLongArrayRegion​(long[] array,
                                              int start,
                                              java.nio.LongBuffer buf)
        Copies back a region of a primitive array from a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the source buffer
      • GetFloatArrayRegion

        public static void GetFloatArrayRegion​(float[] array,
                                               int start,
                                               java.nio.FloatBuffer buf)
        Copies a region of a primitive array into a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the destination buffer
      • SetFloatArrayRegion

        public static void SetFloatArrayRegion​(float[] array,
                                               int start,
                                               java.nio.FloatBuffer buf)
        Copies back a region of a primitive array from a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the source buffer
      • GetDoubleArrayRegion

        public static void GetDoubleArrayRegion​(double[] array,
                                                int start,
                                                java.nio.DoubleBuffer buf)
        Copies a region of a primitive array into a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the destination buffer
      • SetDoubleArrayRegion

        public static void SetDoubleArrayRegion​(double[] array,
                                                int start,
                                                java.nio.DoubleBuffer buf)
        Copies back a region of a primitive array from a buffer.
        Parameters:
        array - a Java array
        start - the starting index
        buf - the source buffer
      • RegisterNatives

        public static int RegisterNatives​(java.lang.Class<?> targetClass,
                                          JNINativeMethod.Buffer methods)
        Registers native methods with the class specified by the targetClass argument. The methods parameter specifies an array of JNINativeMethod structures that contain the names, signatures, and function pointers of the native methods. The name and signature fields of the JNINativeMethod structure are pointers to modified UTF-8 strings. The nMethods parameter specifies the number of native methods in the array.
        Parameters:
        methods - the native methods in the class
        Returns:
        “0” on success; returns a negative value on failure
      • UnregisterNatives

        public static int UnregisterNatives​(java.lang.Class<?> targetClass)
        Unregisters native methods of a class. The class goes back to the state before it was linked or registered with its native method functions.

        This function should not be used in normal native code. Instead, it provides special programs a way to reload and relink native libraries.

        Parameters:
        targetClass - a Java class object
        Returns:
        “0” on success; returns a negative value on failure
      • GetJavaVM

        public static int GetJavaVM​(PointerBuffer vm)
        Returns the Java VM interface (used in the Invocation API) associated with the current thread. The result is placed at the location pointed to by the second argument, vm.
        Parameters:
        vm - a pointer to where the result should be placed
      • GetStringRegion

        public static void GetStringRegion​(java.lang.String str,
                                           int start,
                                           java.nio.ByteBuffer buf)
        Copies len number of Unicode characters beginning at offset start to the given buffer buf.
      • GetStringUTFRegion

        public static void GetStringUTFRegion​(java.lang.String str,
                                              int start,
                                              int len,
                                              java.nio.ByteBuffer buf)
        Translates len number of Unicode characters beginning at offset start into modified UTF-8 encoding and place the result in the given buffer buf.
      • NewWeakGlobalRef

        public static long NewWeakGlobalRef​(java.lang.Object obj)
        Creates a new weak global reference. Returns NULL if obj refers to null, or if the VM runs out of memory. If the VM runs out of memory, an OutOfMemoryError will be thrown.
      • nDeleteWeakGlobalRef

        public static void nDeleteWeakGlobalRef​(long weakGlobalRef)
        Unsafe version of: DeleteWeakGlobalRef(long)
      • DeleteWeakGlobalRef

        public static void DeleteWeakGlobalRef​(long weakGlobalRef)
        Delete the VM resources needed for the given weak global reference.
      • nNewDirectByteBuffer

        @Nullable
        public static java.nio.ByteBuffer nNewDirectByteBuffer​(long address,
                                                               long capacity)
      • NewDirectByteBuffer

        @Nullable
        public static java.nio.ByteBuffer NewDirectByteBuffer​(long address,
                                                              long capacity)
        Allocates and returns a direct java.nio.ByteBuffer referring to the block of memory starting at the memory address address and extending capacity bytes.

        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.

        Parameters:
        address - the starting address of the memory region (must not be NULL)
        capacity - the size in bytes of the memory region (must be positive)
        Returns:
        a local reference to the newly-instantiated java.nio.ByteBuffer object. Returns NULL if an exception occurs, or if JNI access to direct buffers is not supported by this virtual machine.
      • GetDirectBufferAddress

        public static long GetDirectBufferAddress​(java.nio.Buffer buf)
        Fetches and returns the starting address of the memory region referenced by the given direct java.nio.Buffer.

        This function allows native code to access the same memory region that is accessible to Java code via the buffer object.

        Parameters:
        buf - a direct java.nio.Buffer object (must not be NULL)
        Returns:
        the starting address of the memory region referenced by the buffer. Returns NULL if the memory region is undefined, if the given object is not a direct java.nio.Buffer, or if JNI access to direct buffers is not supported by this virtual machine.
      • GetObjectRefType

        public static int GetObjectRefType​(java.lang.Object obj)
        Returns the type of the object referred to by the obj argument. The argument obj can either be a local, global or weak global reference.
        Parameters:
        obj - a local, global or weak global reference