If the argument is intended to be an array of arrays, then the layout
in memory looks like this:
If your argument is Pointer with value x:
x+0: ptr to first array
x+4: ptr to next array
x+8: ptr to next array ...
In which case you need to pass in Pointer[]. You should be able to
initialize the elements with com.sun.jna.Memory, allocating blocks of
appropriate size.
On Feb 3, 2009, at 1:24 PM, Travis Banks wrote:
Hello All,
I'm having trouble representing the type int** in Java and could use
some assistance. The function I want to call has the following
signature;
do_iteration(int **data, int num_datapoints, Options *options,
Message *message)
I know that 'data' is processed in the function as an int[][] and that
'data' is passed to other functions (where it is modified) from within
do_iterations. 'data' is not empty when I call the argument from Java
but must be populated. I've tried the following things but have had
not luck;
do_iteration(IntBuffer[] data, int num_datapoints, Options options,
Message message) - Exception in thread "main"
java.lang.IllegalArgumentException: Unsupported array argument type:
class java.nio.IntBuffer
do_iteration(Pointer[] data, int num_datapoints, Options options,
Message message) - I use Native.getDirectBufferPointer() to get the
pointers but I get;
'Exception in thread "main" java.lang.IllegalArgumentException:
Non-direct Buffer is not supported'
do_iteration(int[][] data,int num_datapoints, Options options, Message
message) - Exception in thread "main"
java.lang.IllegalArgumentException: Unsupported array argument type:
class [I
Thanks for any help you can give me.
- Travis