I'm taking on a project to decompress data that is compressed with LZ4, but is also no longer in proper files in the file system. I mean for example I have a full disk image, and a large portion of that has LZ4-compressed data. I just found the open source Java implementation of LZ4 compressor/decompressor (by jpountz/Adrien Grand), LZ4 Java. I would like to use that, or modify if possible, to build a Java tool for these purposes.
Right now I see in an example- https://github.com/lz4/lz4-java/blob/master/src/test/net/jpountz/example/LZ4Example.java
It looks rather simple to compress and decompress. For decompressing, a person must know either uncompressed or compressed data length.
I think I won't know the length of files contained in the compressed data. And I also won't know the beginning and end of files within the image file. But as an experiment, I have cropped smaller chunks of data out of that image and used 7-Zip ZS (supports LZ4) to extract proper files (like an XML file that is complete and correct). But that only retrieved one or two files at a time.
I have data processing experience, but haven't worked with LZ4 compression before (or really any compression in a programming project). Does anyone have idea for how I should go about this? For someone knowledgeable on LZ4 Java, does this seem feasible?
Also, I wonder how did 7-Zip extract/decompress perfect files? It must know where the file started and ended. Here I have some reading on the "LZ4 Block Format Description". But any additional insight is appreciated.
Keep in mind this project is not meant to extract everything perfectly. Some is better than none. Thanks for any input.