Top Description Fields Constructors Methods
com.badlogic.gdx.jnigen

public Class JniGenSharedLibraryLoader

extends Object
Class Inheritance
Annotations
@Deprecated
Imports
java.io.File, .FileInputStream, .FileNotFoundException, .FileOutputStream, .IOException, .InputStream, java.util.HashSet, .Set, java.util.zip.CRC32, .ZipEntry, .ZipFile

Deprecated

Loads shared libraries from a natives jar file (desktop) or arm folders (Android). For desktop projects, have the natives jar in the classpath, for Android projects put the shared libraries in the libs/armeabi and libs/armeabi-v7a folders. See AntScriptGenerator. This class is deprecated in favor of SharedLibraryLoader.
Author
mzechner

Field Summary

Modifier and TypeField and Description
private SharedLibraryFinder
private static Set<String>
private String
private ZipFile

Constructor Summary

AccessConstructor and Description
public
public
JniGenSharedLibraryLoader(String nativesJar)

Fetches the natives from the given natives jar file.

public
JniGenSharedLibraryLoader(String nativesJar, SharedLibraryFinder
A custom libraryfinder, which enables the use of different dynamic libs naming.
libraryFinder
)

Fetches the natives from the given natives jar file.

Method Summary

Modifier and TypeMethod and Description
public String
crc(InputStream input)

Returns a CRC of the remaining bytes in the stream.

private String
extractLibrary(String sharedLibName)

private InputStream
getFromJar(String jarFile, String sharedLibrary)

public synchronized void
load(String sharedLibName)

Loads a shared library with the given name for the platform the application is running on.

private boolean
loadLibrary(String sharedLibName)

public void
setSharedLibraryFinder(SharedLibraryFinder libraryFinder)

Setting a SharedLibraryFinder enables you to load libraries according to a nondefault natives jar layout or library names.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

libraryFinderback to summary
private SharedLibraryFinder libraryFinder
loadedLibrariesback to summary
private static Set<String> loadedLibraries
nativesJarback to summary
private String nativesJar
nativesZipback to summary
private ZipFile nativesZip

Constructor Detail

JniGenSharedLibraryLoaderback to summary
public JniGenSharedLibraryLoader()
JniGenSharedLibraryLoaderback to summary
public JniGenSharedLibraryLoader(String nativesJar)

Fetches the natives from the given natives jar file. Used for testing a shared lib on the fly, see MyJniClass.

JniGenSharedLibraryLoaderback to summary
public JniGenSharedLibraryLoader(String nativesJar, SharedLibraryFinder libraryFinder)

Fetches the natives from the given natives jar file. Used for testing a shared lib on the fly, see MyJniClass.

Parameters
libraryFinder:SharedLibraryFinder

A custom libraryfinder, which enables the use of different dynamic libs naming.

Method Detail

crcback to summary
public String crc(InputStream input)

Returns a CRC of the remaining bytes in the stream.

extractLibraryback to summary
private String extractLibrary(String sharedLibName)
getFromJarback to summary
private InputStream getFromJar(String jarFile, String sharedLibrary) throws IOException
loadback to summary
public synchronized void load(String sharedLibName)

Loads a shared library with the given name for the platform the application is running on. The name should not contain a prefix (e.g. 'lib') or suffix (e.g. '.dll).

loadLibraryback to summary
private boolean loadLibrary(String sharedLibName)
setSharedLibraryFinderback to summary
public void setSharedLibraryFinder(SharedLibraryFinder libraryFinder)

Setting a SharedLibraryFinder enables you to load libraries according to a nondefault natives jar layout or library names.