我想将java中的ArrayList转换为c++中的vector。我怎样才能做到这一点?
Input:c++中的jobject input,即JAVA中的ArrayList。输出:c++中名为vector的类;
//找到jclass 4 ArrayList,只测试jposCommits和jnegCommits是ArrayList的实例
jclass cls_arraylist = env->FindClass("java/util/ArrayList");
//get element
jmethodID arraylist_get = env->GetMethodID(cls_arraylist, "get", "(I)Ljava/lang/Object;");
//get array size
jmethodID arraylist_size = env->GetMethodID(cls_arraylist,"size","()I");
//get the length of pos and neg commits
jint lenArrayList_byte32 = env->CallIntMethod(jobArrayList_byte32, arraylist_size);
vector<byte[]> retKeyV;
for (int i = 0; i < lenArrayList_byte32; ++i) {
jobject joneKey = env->CallObjectMethod(jobArrayList_byte32, arraylist_get, i);
下一步我能做什么