The most obvious issue is that the interface in Listing 6 requires a JNI call for each bit set or retrieved, as well as a JNI call to read a byte from, or write a byte to, the serial port.
最显著的一个问题就是,清单6中的接口在设置或检索每个位,以及从串行端口读取字节或者向串行端口写入字节都需要一个JNI调用。
The second file contains JNI native declarations for each of the methods in the interface, shown in Listing 5.
第二个文件包含接口中每个方法的JNI本机声明,如清单5所示。
For example, if we want to provide an interface to a serial port using JNI, we could come up with two different interfaces. One version is in Listing 6.
举例来说,如果我们希望使用JNI为某个串行端口提供接口,则可以构造两种不同的接口。
应用推荐