The JNI lets you accomplish these tasks.
JNI允许您完成这些任务。
Only valid Pointers are passed to JNI methods.
传递给JNI方法的指针都是有效的。
JNI code does not read past the ends of arrays.
JNI代码未读取超过数组结束部分之外的内容。
Validating new code against the JNI specification
根据JNI规范验证新代码
The flag has three sub-flags: gc, class, and jni.
该标志有三个子标志:gc、class和jni。
JNI programming pitfalls fall into two categories.
JNI编程缺陷可以分为两类。
The second switch is from a JNI layer to a kernel space.
第二个切换是从jni层到内核空间。
A string representing the method's signature in JNI syntax.
以jni语法表示方法签名的字符串。
See the Resources section below for more information on JNI.
请参阅下面的参考资料部分以获得关于 JNI 的更多信息。
The parameters passed to JNI methods are of the correct types.
传递给JNI方法的参数属于正确的类型。
List all the occurrences of JNI references in your application.
列出应用程序中出现的所有JNI引用。
You enable the JNI check option with the following command line.
您可以通过以下命令行启用JNI检测选项。
The JNI specification states that each JNIEnv is local to a thread.
JNI规范规定每个JNIEnv 对于线程来说都是本地的。
Local references are created for any object returned by a JNI function.
jni函数返回的任何对象都会创建本地引用。
Jni is of little use except when working with jni and native libraries.
jni很少使用,除了使用jni或本地库时。
This leads to nine times as many JNI calls for each byte read or written.
这会导致读取或写入的每个字节的JNI调用变成原来的9倍。
For example, Listing 1 shows the JNI code required to call a static method.
举例来说,清单1展示了调用静态方法所需的JNI代码。
Not all the findings the JNI check reports are necessarily errors in the code.
JNI检测报告的所有结论并不一定都是代码中的错误。
Certain JNI functions can use native memory as part of their normal operation.
某些JNI功能可以将本机内存作为它们普通操作的一部分使用。
Thus, you have to modify the signatures of existing functions to work with JNI.
因而,您不得不修改现有函数的署名以便使用JNI。
The native code that runs in the same process space as the invoking JVM under JNI.
本机代码是作为JNI中的调用JVM运行在相同的进程空间内的。
The first parameter is the JNI environment, frequently used with helper functions.
第一个参数是JNI环境,它与helper 函数会被频繁调用。
Don't think that you need to be an expert in native code or JNI or must know every OS.
不要认为自己必须是一名本机代码或JNI专家,或者必须知道每个操作系统。
Many JNI methods have a return value that indicates whether the call succeeded or not.
许多JNI方法都通过返回值来指示调用成功与否。
Then, to pass the result back, you can use a JNI helper function called NewStringUTF .
然后,为了传回结果,你可以使用一个叫作newstringutf的JNIhelper函数。
Note that it is beyond the scope of this article to provide a complete description of JNI.
注意,提供JNI的完整描述不在本文范围之内。
Many of the JNI methods that natives can call can raise exceptions on the executing thread.
本机能调用的许多JNI方法都会引起与执行线程相关的异常。
As we pointed out in our introduction, the use of JNI isn't sufficient to meet these needs.
正如我们在引言中所指出的,JNI的使用并不能满足这些需求。
This article covers the 10 most common coding and design errors that users of the JNI make.
本文介绍JNI用户最常遇到的10大编码和设计错误。
The native may not make any JNI calls between these methods and may not block for any reason.
本机可能不会在这些方法之间发起任何调用,并且可能不会由于任何原因而阻塞。
应用推荐