Reputation: 1691
I'm using JNI/NDK to tie in some C++ libraries with an Android app. One of the Java methods uses a byte array, so I need to call GetByteArrayElements in the JNI bindings. In what cases does GetByteArrayElements return NULL? Oracle's documentation simply states:
Returns a pointer to the array elements, or NULL if the operation fails.
What cases can cause the operation to fail and return NULL?
Upvotes: 2
Views: 1389
Reputation: 310985
It returns NULL if the operation fails, and not otherwise, including your case of an empty array.
Upvotes: 1