This is the first time that I use the JNI and also the first time that I have to write some lines in C.
What I am trying to do is very simple. I\'m just trying to sw
qrtt has given you a great answer.
However, the JNI has very comprehensive and (relatively) easy-to-understand documentation that you should read front-to-back if you will be using JNI features again in the future. You can find it here: http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/jniTOC.html
For your particular case, here's the section on dealing with arrays: http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/design.html#wp1265
you can get jbyte* by GetByteArrayElements:
jbyte* bufferPtr = (*env)->GetByteArrayElements(env, array, NULL);
And it is important to know the length of your array:
jsize lengthOfArray = (*env)->GetArrayLength(env, array);
Having jbyte* and length, you can do all the things in c-array. Finally, releasing it:
(*env)->ReleaseByteArrayElements(env, array, bufferPtr, 0);