public class SharedLibraryLoader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
is64Bit |
static boolean |
isAndroid |
static boolean |
isIos |
static boolean |
isLinux |
static boolean |
isMac |
static boolean |
isWindows |
Constructor and Description |
---|
SharedLibraryLoader() |
SharedLibraryLoader(java.lang.String nativesJar)
Fetches the natives from the given natives jar file.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
crc(java.io.InputStream input)
Returns a CRC of the remaining bytes in the stream.
|
java.io.File |
extractFile(java.lang.String sourcePath,
java.lang.String dirName)
Extracts the specified file into the temp directory if it does not already exist or the CRC does not match.
|
void |
load(java.lang.String libraryName)
Loads a shared library for the platform the application is running on.
|
java.lang.String |
mapLibraryName(java.lang.String libraryName)
Maps a platform independent library name to a platform dependent name.
|
public static boolean isWindows
public static boolean isLinux
public static boolean isMac
public static boolean isIos
public static boolean isAndroid
public static boolean is64Bit
public SharedLibraryLoader()
public SharedLibraryLoader(java.lang.String nativesJar)
nativesJar
- public java.lang.String crc(java.io.InputStream input)
public java.lang.String mapLibraryName(java.lang.String libraryName)
public void load(java.lang.String libraryName)
libraryName
- The platform independent library name. If not contain a prefix (eg lib) or suffix (eg .dll).public java.io.File extractFile(java.lang.String sourcePath, java.lang.String dirName) throws java.io.IOException
sourcePath
- The file to extract from the classpath or JAR.dirName
- The name of the subdirectory where the file will be extracted. If null, the file's CRC will be used.java.io.IOException