If the application provides a direct byte buffer, then the C++ side of the JNI can receive the pointer with GetDirectBufferAddress, which skips an unnecessary copy as the data crosses the C++/Java interface (GetPrimitiveArrayCritical can cause a copy if the array is fragmented on the Java heap)