Usually, when you pass data through the JNI, it will be copied across the JNI border. If you need an efficient mechanism for transferring data from your native space to your Java space, you should look at how to access direct NIO bytes. This can provide a partition of memory that can be shared between native code and Java code. See GetDirectBufferAddress .
source share