Moved LZ4 to its own class to male LZ4 optional

master
Robinson 2023-08-06 17:36:13 -06:00
parent 16c4fcaff5
commit 0553cce310
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 11 additions and 0 deletions

View File

@ -24,6 +24,17 @@ import java.io.InputStream
import java.security.NoSuchAlgorithmException
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 {
ThreadLocal.withInitial {
try {