JNI

M

mike7411

If you just want to copy data from a char* in C++ to a byte[] in Java
using JNI, what is the fastest way to do this?


Is this right?

JNIEXPORT void JNICALL Java_copy(JNIEnv *env, jbyteArray jb)
{
const char* = "the data I want to copy";
env->SetByteArrayRegion(jb, 0, strlen(str), (jbyte *)str);
}
 
G

Gordon Beaton

If you just want to copy data from a char* in C++ to a byte[] in Java
using JNI, what is the fastest way to do this?

Is this right?

It could be, assuming you've done some things right in Java as well.
What happened when you tried?

/gordon

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top