Since you're expecting the target function to fill in your buffer, you cannot pass a String
(which is read-only) but must instead pass a byte[]
.
Also make sure you're not using Java long
to represent native long
; the class NativeLong
exists for that purpose.
If what you get back is a NUL-terminated C string, then you can use Native.toString(byte[])
to convert to a String
.