lz4 / lz4-java

LZ4 compression for Java
Apache License 2.0
1.1k stars 253 forks source link

Where is the pure java implementation gone? #125

Closed Stefan311 closed 5 years ago

Stefan311 commented 6 years ago

Got an exception: Exception in thread "Thread-2" java.lang.AssertionError: java.lang.ClassNotFoundException: net.jpountz.lz4.LZ4JavaSafeCompressor at net.jpountz.lz4.LZ4Factory.instance(LZ4Factory.java:53) at net.jpountz.lz4.LZ4Factory.safeInstance(LZ4Factory.java:98)

Seem several java files are missing since 1.2 branch.

odaira commented 5 years ago

How did you get this exception? net.jpountz.lz4.LZ4JavaSafeCompressor does exist in lz4-java-1.4.1.jar.

Stefan311 commented 5 years ago

I downloaded the master branch and included the java files directly into my project. This would work if the named file are there - but they don't. How could you have this class file in your jar, if the java file is not in the source path? Can you see how old the class file in your jar is? The jar is not included into the git repository. Is there a reason for this? Building one is usually a complicated process, especially if there are native dependencies. Since I not need (and not want) native bindings, I not even tried to build the jar. Including just the java files work very well with the 1.1 branch.

odaira commented 5 years ago

It won't work. LZ4JavaSafeCompressor and some other classes are generated from template files at build time. You can download the jar from Maven Central http://repo1.maven.org/maven2/org/lz4/lz4-java/, linked from the top page.

Stefan311 commented 5 years ago

Thanks for reply. What won't work? Including just the java files? It actually DO work with files from the 1.1 branch.

I copyed LZ4Exception.java, LZ4JavaSafeCompressor.java, LZ4JavaSafeUnknownSizeDecompressor.java, LZ4Utils.java, Utils.java and just call it like this: int dlen = LZ4JavaSafeUnknownSizeDecompressor.INSTANCE.decompress(in, offset, clen, target, 0, maxsize); Thats exactly what I want. I was just confused not to find the named files in the master branch.

Don't misunderstand me. I just thought the java files got lost and no one note. If they added by a strange way during build time, everything is fine.

odaira commented 5 years ago

Including just the Java files might have worked in 1.1 but does not in the current version, unfortunately. Can I close this issue?

Stefan311 commented 5 years ago

Yes, you can close this ticket. Thank you.