JNA how call a method from java in an Pointer received from dll?
<p>I have a method in the dll which returns a pointer to an object</p>

<p>C code</p>

<pre><code>basic_hash* getAlgorithmInstance( int algorithm )
</code></pre>

<p>object has the following methods:</p>

<pre><code>void reset ();
void hash (const byte* data, uint64 size, vector_byte&amp; hash).
</code></pre>

<p>how can I call the methods of this object?</p>

<p>I have an implementation which returns a pointer</p>

<p>java code</p>

<pre><code>public interface LIB extends Library {
        LIB INSTANCE = (LIB ) Native.loadLibrary(
                (Platform.isWindows() ? "LIB " : "linuxLIB"), LIB.class);
        Pointer getAlgorithmInstance(int i);
    }

    public static void main(String[] args) {
        try {
            LIB lib = LIB.INSTANCE;
            Pointer pointer = lib.getAlgorithmInstance(0);
            //pointer.reset(); //TODO how call?
        } catch (Exception e) {
            e.printStackTrace();
            return;
        }
    }
</code></pre>