Class JNIPointerReference

  • Direct Known Subclasses:
    FfmpegIOHandle

    public class JNIPointerReference
    extends java.lang.Object
    Internal Only. An Opaque handle that holds a Native mPointer/handle. This class holds a opaque long value that can be used to pass into JNI C function that expect a ** in C.

    For example, a function like this in native code:

       int url_open(URLContext **handlePtr, char *name, int flags);
       int url_read(URLContext *handle, void* buf, int len);
     
    might map to the following Java method:
     public class Example {
       public native int url_open(JNIPointerReference p, String name, int flags);
       public native int url_read(JNIPointerReference p, byte[] buf, int len);
       public void example() {
          int retval = 0;
          JNIPointerReference p;
          // p.setPointer is called by the native function 
          retval = url_open(p, "foo", 0);
          
          // p.getPointer is called by the native function
          byte[] buf = new bytes[1024];
          retval = url_read(p, buf, buf.length);
       }
     

    IMPORTANT: DO NOT RENAME THIS CLASS OR METHODS IN IT. NATIVE CODE DEPENDS ON THE NAMES AND SIGNATURES.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String toString()
      Internal Only.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • toString

        public java.lang.String toString()
        Internal Only.
        Overrides:
        toString in class java.lang.Object