Moved LZ4 to its own class to male LZ4 optional
This commit is contained in:
parent
16c4fcaff5
commit
0553cce310
|
@ -24,6 +24,17 @@ import java.io.InputStream
|
||||||
import java.security.NoSuchAlgorithmException
|
import java.security.NoSuchAlgorithmException
|
||||||
|
|
||||||
object LZ4Util {
|
object LZ4Util {
|
||||||
|
init {
|
||||||
|
try {
|
||||||
|
Class.forName("net.jpountz.xxhash.XXHashFactory")
|
||||||
|
}
|
||||||
|
catch (e: Exception) {
|
||||||
|
System.err.println("Please add the LZMA library to your classpath, for example: implementation(\"org.lz4:lz4-java:1.8.0\")")
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private val xxHashFactory: ThreadLocal<XXHashFactory> by lazy {
|
private val xxHashFactory: ThreadLocal<XXHashFactory> by lazy {
|
||||||
ThreadLocal.withInitial {
|
ThreadLocal.withInitial {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue