I'm trying to use JNA to call native API in Scala. I don't know how to pass pointer of array of byte (byte**).
The signature of native API follows:
// this function mallocs some array buffer and stores it to passed pointer value
int func(byte **output);
Then I tried to pass pointer like this:
class NativeLibrary extends Library {
def func(output: Array[Byte]) // doesn't work. thats' for byte*, not byte**
def func(output: Array[Array[Byte]]) // doesn't work. JNA doesn't support this type
def func(output: Memory) // works, but I don't know how to get inner array
}
Both don't seem to work, returning broken pointer value or raising SEGV.
How can I retrieve array from this native function?
Actual native function: https://github.com/VOICEVOX/voicevox_core/blob/0.13.0/core/src/core.h#L169