package org.zeromq.czmq;

public class ZFrame implements AutoCloseable {

    long pointer;

    public ZFrame() {
        pointer = ZFrame.__init();
    }

    public ZFrame(long address) {
        pointer = address;
    }

    public ZFrame(byte[] buf, long size) {
        pointer = ZFrame.__init(buf, size);
    }

    public long size() {
        return ZFrame.__size(pointer);
    }
    native static long __init();

    native static long __init(byte[] buf, long size);

    native static void __destroy(long pointer);

    native static long __size(long pointer);

    @Override
    public void close() {
        ZFrame.__destroy(pointer);
        pointer = 0;
    }
}

package org.zeromq.czmq;

public class ZFrame implements AutoCloseable {

    long pointer;

    public ZFrame() {
        pointer = __init();
    }

    public ZFrame(long address) {
        pointer = address;
    }

    public ZFrame(byte[] buf, long size) {
        pointer = __init(buf, size);
    }
    native static long __init();

    native static long __init(byte[] buf, long size);

    native static void __destroy(long pointer);

    @Override
    public void close() {
        __destroy(pointer);
        pointer = 0;
    }
}

--- 
+++ 
@@ -5,7 +5,7 @@
     long pointer;
 
     public ZFrame() {
-        pointer = __init();
+        pointer = ZFrame.__init();
     }
 
     public ZFrame(long address) {
@@ -13,7 +13,11 @@
     }
 
     public ZFrame(byte[] buf, long size) {
-        pointer = __init(buf, size);
+        pointer = ZFrame.__init(buf, size);
+    }
+
+    public long size() {
+        return ZFrame.__size(pointer);
     }
     native static long __init();
 
@@ -21,9 +25,11 @@
 
     native static void __destroy(long pointer);
 
+    native static long __size(long pointer);
+
     @Override
     public void close() {
-        __destroy(pointer);
+        ZFrame.__destroy(pointer);
         pointer = 0;
     }
 }
Call from the static context
