java - Putting JNI primitive types into same array -
i trying write static java method given parameters, searches , invokes method.
this method supposed have variable amount of arguments, , must called c++. tried few options, cannot done. possible?
so far, can store types contains , position, , can put jobject , jstring in same array.
if not possible, possible refer either methodid found jni java's reflection or somehow pass reference object in long. such structure ok, since can cast 64 bit integer else.
if need array in jni, use jvalue union type array type. ex: jvalue myarray* = { (jint) 1, (jlong) 1000, (jboolean) false }
java not support jvalue nor support variadic functions, if need pass array of primitives jni java way of working around limitation, should use object array primitive object wrappers java.lang.integer , call value functions depending on type in jni. possible, pain implement.
Comments
Post a Comment