/** Return a {@link LZ4Factory} instance that returns compressors and * decompressors that are written with Java's official API. */ public static synchronized LZ4Factory safeInstance() { if (JAVA_SAFE_INSTANCE == null) { JAVA_SAFE_INSTANCE = instance("JavaSafe"); } return JAVA_SAFE_INSTANCE; }
/** Return a {@link LZ4Factory} instance that returns compressors and * decompressors that are written with Java's official API. */ public static synchronized LZ4Factory safeInstance() { if (JAVA_SAFE_INSTANCE == null) { JAVA_SAFE_INSTANCE = instance("JavaSafe"); } return JAVA_SAFE_INSTANCE; }
/** Return a {@link LZ4Factory} instance that returns compressors and * decompressors that may use {@link sun.misc.Unsafe} to speed up compression * and decompression. */ public static synchronized LZ4Factory unsafeInstance() { if (JAVA_UNSAFE_INSTANCE == null) { JAVA_UNSAFE_INSTANCE = instance("JavaUnsafe"); } return JAVA_UNSAFE_INSTANCE; }
/** Return a {@link LZ4Factory} instance that returns compressors and * decompressors that may use {@link sun.misc.Unsafe} to speed up compression * and decompression. */ public static synchronized LZ4Factory unsafeInstance() { if (JAVA_UNSAFE_INSTANCE == null) { JAVA_UNSAFE_INSTANCE = instance("JavaUnsafe"); } return JAVA_UNSAFE_INSTANCE; }
/** * Return a {@link LZ4Factory} instance that returns compressors and * decompressors that are native bindings to the original C library. * <p> * Please note that this instance has some traps you should be aware of:<ol> * <li>Upon loading this instance, files will be written to the temporary * directory of the system. Although these files are supposed to be deleted * when the JVM exits, they might remain on systems that don't support * removal of files being used such as Windows. * <li>The instance can only be loaded once per JVM. This can be a problem * if your application uses multiple class loaders (such as most servlet * containers): this instance will only be available to the children of the * class loader which has loaded it. As a consequence, it is advised to * either not use this instance in webapps or to put this library in the lib * directory of your servlet container so that it is loaded by the system * class loader. * </ol> */ public static synchronized LZ4Factory nativeInstance() { if (NATIVE_INSTANCE == null) { NATIVE_INSTANCE = instance("JNI"); } return NATIVE_INSTANCE; }
/** * Return a {@link LZ4Factory} instance that returns compressors and * decompressors that are native bindings to the original C library. * <p> * Please note that this instance has some traps you should be aware of:<ol> * <li>Upon loading this instance, files will be written to the temporary * directory of the system. Although these files are supposed to be deleted * when the JVM exits, they might remain on systems that don't support * removal of files being used such as Windows. * <li>The instance can only be loaded once per JVM. This can be a problem * if your application uses multiple class loaders (such as most servlet * containers): this instance will only be available to the children of the * class loader which has loaded it. As a consequence, it is advised to * either not use this instance in webapps or to put this library in the lib * directory of your servlet container so that it is loaded by the system * class loader. * </ol> */ public static synchronized LZ4Factory nativeInstance() { if (NATIVE_INSTANCE == null) { NATIVE_INSTANCE = instance("JNI"); } return NATIVE_INSTANCE; }