I'm passing an int array from Java to native method. 
Then within JNI function I created a pointer to int array with GetIntArrayElements() and pass as \*isCopy argument JNI\_FALSE. I supposed that this will not create a copy of the original array and I could modify array in place. Then I use ReleaseIntArrayElements() and pass as mode argument JNI\_ABORT to just relese buffer. But that didn't work.

From JNI documentation:

* mode 0: copy back the content and free the elems buffer
* mode JNI\_COMMIT: copy back the content but do not free the elems buffer
* mode JNI\_ABORT: free the buffer without copying back the possible changes

That when I tried to use mode "0" in ReleaseIntArrayElements() that worked perfectly. But I don't understand why cause I didn't create a copy of the original array and mode "0" is copying back the content.

I suppose that JNI always create a copy of the original array. But then \*isCopy argument in GetIntArrayElements() lose its sense. So what really happening with this?

**THIS IS MY JNI FUCNTION**

```
extern "C" JNIEXPORT jdouble JNICALL
Java_my_own_package_MainActivity_myFunction(
    JNIEnv *env,
    jobject /* this */, jintArray tbl) {
    jint *tblptr = env->GetIntArrayElements(tbl, JNI_FALSE);
    tblptr[0] = 0; //in-place change
    env->ReleaseIntArrayElements(tb1, tblptr, JNI_ABORT);
    return 0;
}

```