java 使用 JNI 的 byte[] 字节数组的方法描述符/签名是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7443069/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is method Descriptor/signature for byte[] byte array using JNI?
提问by Rohan K
My JAVA class code snippet. I want to access getReg_chal() method from my C file using JNI:
我的 JAVA 类代码片段。我想使用 JNI 从我的 C 文件访问 getReg_chal() 方法:
public byte[] getReg_chal() {
return reg_chal;
}
My C file doing some jni operation:
我的 C 文件做一些 jni 操作:
mid = (*env)->GetMethodID(env, info, "getReg_chal()", "([B)V");
mid = (*env)->GetMethodID(env, info, "getReg_chal()", ***);
I want to know the method descriptor for my byte[]. Writing "({B)V"
gives me method not found error. What would I fill in ***?
Please help me. Thanks in advance.
我想知道我的 byte[] 的方法描述符。写作"({B)V"
给了我方法未找到错误。我会填什么***?请帮我。提前致谢。