Alex
Alex

Reputation: 131

What is the Java type for *short using JNA

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

Upvotes: 0

Views: 666

Answers (1)

Mark Elliot
Mark Elliot

Reputation: 77044

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);

Upvotes: 2

Related Questions