Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Copying jbytearray into unsigned char array.

843829Aug 29 2001 — edited Oct 27 2009
I'm accessing jbytearray from Java to C++ program and want to copy the jbyteArray in C++ into array of type 'unsigned char' and of same length .
Following code I wrote:

JNIEXPORT void JNICALL Java_UserFrontEnd_ImageSensor_FPMMatch
(JNIEnv *env, jobject, jbyteArray minut){

unsigned char minut1[400]; //array in cpp

jsize len = env->GetArrayLength(minut); //this gives len = 400

jbyte *minbyteA = env->GetByteArrayElements(minut, 0);

//Now how do I copy minut into minut1 ?

env->ReleaseByteArrayElements(minut, minbyteA, 0);

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2009
Added on Aug 29 2001
10 comments
3,427 views