XXHash32 and StreamingXXHash32 instances.
This class has 3 instances
native instance which is a JNI binding to
the original LZ4 C implementation.
safe Java instance which is a pure Java port
of the original C library,unsafe Java instance which is a Java port
using the unofficial sun.misc.Unsafe API.
Only the safe instance is guaranteed to work on your
JVM, as a consequence it is advised to use the fastestInstance() or
fastestJavaInstance() to pull a XXHashFactory instance.
All methods from this class are very costly, so you should get an instance
once, and then reuse it whenever possible. This is typically done by storing
a XXHashFactory instance in a static field.
| Modifier and Type | Field and Description |
|---|---|
| private final XXHash32 | |
| private final XXHash64 | |
| private final String | |
| private static XXHashFactory | |
| private static XXHashFactory | |
| private static XXHashFactory | |
| private final StreamingXXHash32. | |
| private final StreamingXXHash64. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static <T> T | |
| public static XXHashFactory | |
| public static XXHashFactory | fastestJavaInstance()
Return the fastest available |
| public XXHash32 | |
| public XXHash64 | |
| private static XXHashFactory | |
| public static void | |
| public static synchronized XXHashFactory | nativeInstance()
Return a |
| public StreamingXXHash32 | |
| public StreamingXXHash64 | |
| public static synchronized XXHashFactory | safeInstance()
Return a |
| public String | |
| public static synchronized XXHashFactory | unsafeInstance()
Return a |
| hash32 | back to summary |
|---|---|
| private final XXHash32 hash32 | |
| hash64 | back to summary |
|---|---|
| private final XXHash64 hash64 | |
| impl | back to summary |
|---|---|
| private final String impl | |
| JAVA_SAFE_INSTANCE | back to summary |
|---|---|
| private static XXHashFactory JAVA_SAFE_INSTANCE | |
| JAVA_UNSAFE_INSTANCE | back to summary |
|---|---|
| private static XXHashFactory JAVA_UNSAFE_INSTANCE | |
| NATIVE_INSTANCE | back to summary |
|---|---|
| private static XXHashFactory NATIVE_INSTANCE | |
| streamingHash32Factory | back to summary |
|---|---|
| private final StreamingXXHash32. | |
| streamingHash64Factory | back to summary |
|---|---|
| private final StreamingXXHash64. | |
| XXHashFactory | back to summary |
|---|---|
| private XXHashFactory(String impl) throws ClassNotFoundException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException | |
| classInstance | back to summary |
|---|---|
private static <T> T classInstance(String cls) throws NoSuchFieldException, SecurityException, ClassNotFoundException, IllegalArgumentException, IllegalAccessException
| |
| fastestInstance | back to summary |
|---|---|
| public static XXHashFactory fastestInstance() Return the fastest available
Please read | |
| fastestJavaInstance | back to summary |
|---|---|
| public static XXHashFactory fastestJavaInstance() Return the fastest available | |
| hash32 | back to summary |
|---|---|
| public XXHash32 hash32() Return a | |
| hash64 | back to summary |
|---|---|
| public XXHash64 hash64() Return a | |
| instance | back to summary |
|---|---|
| private static XXHashFactory instance(String impl) | |
| main | back to summary |
|---|---|
| public static void main(String[] args) Prints the fastest instance. | |
| nativeInstance | back to summary |
|---|---|
| public static synchronized XXHashFactory nativeInstance() Return a Please note that this instance has some traps you should be aware of:
| |
| newStreamingHash32 | back to summary |
|---|---|
| public StreamingXXHash32 newStreamingHash32(int seed) Return a new | |
| newStreamingHash64 | back to summary |
|---|---|
| public StreamingXXHash64 newStreamingHash64(long seed) Return a new | |
| safeInstance | back to summary |
|---|---|
| public static synchronized XXHashFactory safeInstance() Return a | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| unsafeInstance | back to summary |
|---|---|
| public static synchronized XXHashFactory unsafeInstance() Return a | |