Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java JNI: How to create an array of byte arrays in native code?

Tags:

java

I'm looking to create an array of byte arrays in native code. I plan to use NewObjectArray() for the outer array, since Java arrays are objects. What should I specify as the class identifier for a Java byte array?

like image 207
zer0stimulus Avatar asked Dec 20 '25 17:12

zer0stimulus


1 Answers

NewByteArray allocates a jbyteArray (which corresponds to byte[]). Each of the primitive types has its own array handling functions in JNI.

like image 92
Michael Brewer-Davis Avatar answered Dec 22 '25 09:12

Michael Brewer-Davis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!