code: public static void loadLibraryFromFile(final String directory, final String filename) throws IOException {
  
  		final String libraryPath = directory + File.separator + filename;
  
  		synchronized (loadedLibrarySet) {
  
  			final File outputFile = new File(directory, filename);
  			if (!outputFile.exists()) {
  
  				// Try to extract the library from the system resources
  				final ClassLoader cl = ClassLoader.getSystemClassLoader();
  				final InputStream in = cl.getResourceAsStream(JAR_PREFIX + filename);
  				if (in == null) {
  					throw new IOException("Unable to extract native library " + filename + " to " + directory);
  				}
  
  				final OutputStream out = new FileOutputStream(outputFile);
  				copy(in, out);
  			}
  
  			System.load(libraryPath);
  			loadedLibrarySet.add(filename);
  		}
  	}
docs: Loads a native library from a file.
  
  @param directory
  the directory in which the library is supposed to be located
  @param filename
  filename of the library to be loaded
  @throws IOException
  thrown if an internal native library cannot be extracted