If you want to use the same kind of "struct" on the java side I would create a class that corresponds to that struct (so that the java and the c developer can talk about the same thing):
class JavaData {
double value1[50];
double value2[50];
int count;
};
Then you need to copy the values from / to the java world when going into JNI. This is an example how you do it:
// get the class
jclass javaDataClass = env->FindClass("JavaData");
// get the field id
jfieldID countField = env->GetFieldID(javaDataClass, "count", "I");
// get the data from the field
cData.count = env->GetIntField(jData, countField);
... (the rest of the parameters)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…