标签:pass led color nic arc 有关 tor ram signed
1 JNIEXPORT jint JNICALL example 2 (JNIEnv * env, jclass obj, jstring address, jshort port, 3 jstring username, jstring password, jlong channel, 4 jintArray start_time, jintArray end_time, jstring path){ 5 6 const char* addr = env->GetStringUTFChars(address, NULL); 7 const char* uname = env->GetStringUTFChars(username, NULL); 8 const char* pwd = env->GetStringUTFChars(password, NULL); 9 char* p = (char*)env->GetStringUTFChars(path, NULL); 10 jint* start = env->GetIntArrayElements(start_time, NULL); 11 jint* end = env->GetIntArrayElements(end_time, NULL); 12 int code = download(addr, (WORD)port, uname, pwd, (DWORD)channel, (DWORD*)start, (DWORD*)end, p); 13 env->ReleaseStringUTFChars(address, addr); 14 env->ReleaseStringUTFChars(username, uname); 15 env->ReleaseStringUTFChars(password, pwd); 16 env->ReleaseStringUTFChars(path, p); 17 env->ReleaseIntArrayElements(start_time, start, 0); 18 env->ReleaseIntArrayElements(end_time, end, 0); 19 20 return code; 21 }
上例中的DWORD就是unsigned long的别名。我们使用的是jintArray.
三、jni加载动态库在windows和linux平台上的不同规则
对于System.loadLibrary("nvr");在windows上加载的是nvr.dll文件而在linux上加载的是libnvr.so文件
四、对于jni方法中返回值为jintArray类型的处理方法
标签:pass led color nic arc 有关 tor ram signed
原文地址:https://www.cnblogs.com/CLAYJJ/p/11336702.html