First of all, thank you for this excellent library.
I am trying to use XZ for Java 1.0 (from http://tukaani.org/xz/xz-java-1.0.zip) with a preset dictionary. The JRE is 1.6u30 When I use a preset dictionary, the program enters an infinite loop. I stepped through it in the debugger and found that the "while" loop in LZMA2OutputStream.writeEndMarker() never terminates, apparently because uncompressedSize in writeChunk() is always zero and therefore pendingSize never decreases.
I do not know if I am making a mistake in calling the library or if this is a bug in the library.
When I remove the line "opt.setPresetDict(oldBytes);" it works fine. Here is the code I am testing (disclaimer: I know it's messy; it's just for a quick test):
First of all, thank you for this excellent library.
I am trying to use XZ for Java 1.0 (from http://tukaani.org/xz/xz-java-1.0.zip) with a preset dictionary. The JRE is 1.6u30 When I use a preset dictionary, the program enters an infinite loop. I stepped through it in the debugger and found that the "while" loop in LZMA2OutputStream.writeEndMarker() never terminates, apparently because uncompressedSize in writeChunk() is always zero and therefore pendingSize never decreases.
I do not know if I am making a mistake in calling the library or if this is a bug in the library.
When I remove the line "opt.setPresetDict(oldBytes);" it works fine. Here is the code I am testing (disclaimer: I know it's messy; it's just for a quick test):
Looks like a bug in the library. Thanks for the bug report. I don't immediately see what's wrong, but I try to fix it in a few days.
I have hopefully fixed it now. See today's commits in the git repository.