public final class NativeUtils extends Object
| Constructor and Description |
|---|
NativeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static NativeUtil |
get()
Gets the current instance of NativeUtil
|
static JVMNativeUtil |
getJVMUtil() |
static LinuxNativeUtil |
getLinuxUtil() |
static Map<String,byte[]> |
getNativeLibraryBinaries()
Helper method to get all shared lib binaries in a map.
|
static WindowsNativeUtil |
getWindowsUtil() |
static boolean |
isJVM() |
static boolean |
isLinux() |
static boolean |
isWindows() |
static void |
set(NativeUtil instance)
Useful for testing/debugging.
|
static void |
setProvider(NativeUtilsProvider instance)
Useful for testing/debugging.
|
public static void set(NativeUtil instance)
public static void setProvider(NativeUtilsProvider instance)
public static boolean isWindows()
public static boolean isLinux()
public static boolean isJVM()
public static JVMNativeUtil getJVMUtil()
public static LinuxNativeUtil getLinuxUtil()
public static WindowsNativeUtil getWindowsUtil()
public static NativeUtil get()
public static Map<String,byte[]> getNativeLibraryBinaries()
System.load(String) with the absolute path to the file on the disk.
Afterwards call set(NativeUtil) with null as parameter to force it to detect the loaded library.
Note that "loading" the library more than once will cause issues. Only do this if you know for sure that
the library has not been loaded automatically, or you know for sure that loading automatically has failed
(Can be detected by calling get() and then checking for NativeUtil.isNoop() returns true.
It only returns true if automatic loading has failed. The cause for this is most likely due to running on an unsupported
platform such as Apple OSX. In that case this method will not help you either...Copyright © 2023. All rights reserved.