tags:

views:

17

answers:

1

What is the Java type for *short using JNA

I have in my dll short and *short, so how can I call short -> int *short -> int[]?

Thanks, Alex

+1  A: 

C short types map to Java short types.

C short* (pointer to a short) maps to Java using JNA's ShortByReference.

If you want to map pointers to arrays, simply write the function in Java using arrays, a function with signature

void foo(int *buf)

Maps in Java as

static void native foo(int[] buf);
Mark E