开发者

What is the Java type for *short using JNA

开发者 https://www.devze.com 2023-01-22 07:04 出处:网络
Wh开发者_运维技巧at is the Java type for *short using JNA I have in my dll short and *short, so how can I call

Wh开发者_运维技巧at 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


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

精彩评论

暂无评论...
验证码 换一张
取 消