Package com.uber.h3core
Class H3CoreLoader
java.lang.Object
com.uber.h3core.H3CoreLoader
public final class H3CoreLoader extends Object
Extracts the native H3 core library to the local filesystem and loads it.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
H3CoreLoader.OperatingSystem
Operating systems supported by H3-Java. -
Method Summary
Modifier and Type Method Description static com.uber.h3core.NativeMethods
loadNatives()
For use when the H3 library should be unpacked from the JAR and loaded.static com.uber.h3core.NativeMethods
loadNatives(H3CoreLoader.OperatingSystem os, String arch)
For use when the H3 library should be unpacked from the JAR and loaded.static com.uber.h3core.NativeMethods
loadSystemNatives()
For use when the H3 library is installed system-wide and Java is able to locate it.
-
Method Details
-
loadNatives
For use when the H3 library should be unpacked from the JAR and loaded.- Throws:
SecurityException
- Loading the library was not allowed by the SecurityManager.UnsatisfiedLinkError
- The library could not be loadedIOException
- Failed to unpack the library
-
loadNatives
public static com.uber.h3core.NativeMethods loadNatives(H3CoreLoader.OperatingSystem os, String arch) throws IOExceptionFor use when the H3 library should be unpacked from the JAR and loaded. The native library for the specified operating system and architecture will be extract.H3 will only successfully extract the library once, even if different operating system and architecture are specified, or if
loadNatives()
was used instead.- Parameters:
os
- Operating system whose lobrary should be usedarch
- Architecture name, as packaged in the H3 library- Throws:
SecurityException
- Loading the library was not allowed by the SecurityManager.UnsatisfiedLinkError
- The library could not be loadedIOException
- Failed to unpack the library
-
loadSystemNatives
public static com.uber.h3core.NativeMethods loadSystemNatives()For use when the H3 library is installed system-wide and Java is able to locate it.- Throws:
SecurityException
- Loading the library was not allowed by the SecurityManager.UnsatisfiedLinkError
- The library could not be loaded
-