0

I have the following JNI function:

JNIEXPORT void JNICALL Java_org_kuku_myProj_myClass
      (JNIEnv *env, jclass java_class, jbyteArray byte_array, jcharArray char_array) {


}

I want to write characters into the actual jcharArray passed to my function. How can I do it?

1 Answer 1

1

Take a look here:

http://jnicookbook.owsiak.org/recipe-No-013/

where you can take a look at: (*env)->ReleaseBooleanArrayElements(env, array, body, mode) with different modes of change acceptance.

/* release body when you decide it is no longer needed
    Pass changes back to Java */
(*env)->ReleaseCharArrayElements(env, array, body, JNI_COMMIT);

Hope that helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.