接口 NativeUtil
public interface NativeUtil
A simple library class which helps with loading dynamic libraries stored in the
JAR archive. These libraries usually contain implementation of some methods in
native code (using JNI - Java Native Interface).
-
字段详细资料
-
NATIVE_FOLDER_PATH_PREFIX
- 另请参阅:
- 常量字段值
-
TEM_DIR
-
isPosixCompliant
static final boolean isPosixCompliant
-
-
方法详细资料
-
loadLibraryFromJar
static void loadLibraryFromJar(@NotNull @NotNull String fileName, @NotNull @NotNull Class<?> callerClass)Loads library from current JAR archiveThe file from JAR is copied into system temporary directory and then loaded. The temporary file is deleted after exiting. Method uses String as fileName because the pathname is "abstract", not system-dependent.
- 参数:
fileName- the native library name under/native/callerClass- the caller class used to callClass.getResourceAsStream(String)- 抛出:
IllegalArgumentException- If source file (param path) does not existIllegalArgumentException- If the path is not absolute or if the fileName is shorter than three characters (restriction ofFile.createTempFile(String, String)).UnsupportedOperationException- ifUnsatisfiedLinkErroris thrown.
-
isPosixCompliant
static boolean isPosixCompliant() -
createTempDirectory
-