java - How to convert/cast a jobject into jbyte* -
i deal byte array retrieved java callback function. however, got error 'jnienv' has no member named 'getobjectelements'
jmethodid funcgetarray = getstaticmethodid(clazz, "getarray", "()[b"); jobject data_obj = env->callstaticobjectmethod(clazz, funcgetarray); const jboolean is_copy = jni_false; jbyte *byte_array = env->getobjectelements(data_obj, is_copy);
can pointer byte array in easy way instead of retrieving each element , copying it.
i think function looking getbytearrayelements
. can cast data_obj
have jbytearray
, pass function.
also should passing pointer is_copy
.
Comments
Post a Comment