According to the example in https://www.javonet.com/java-devs/guides/working-with-net-arrays-and-collections-from-java-with-javonet/, if the dll that Java is calling returns an array of ints, Javonet will only display an array of Integer classes (not primitives). Since the arrays are huge in my case (~2GB worth of arrays), is there any way for Javonet to NOT autobox, but instead return an array of primitives?
We have implemented the mechanism to allow you choosing if Javonet should return boxed or unboxed arrays. It can be used for entire scope of your application or set temporarily for particular operations, however please keep in mind that its beta build and the option affects all threads so if used selectively should be used with caution.
Please use this build: http://download.javonet.com/1.5/javonet-1.5hf15-primitivearrays-opti-jtdn.jar
To activate primitive arrays mode call at any time:
This mode affects all primitive types: int, long, short, byte, float, double, boolean, char... To cancel this mode just set "false".
Once confirmed that it improves your performance, we will include that in final build and update this answer respectively.