Hi guys,
I'm the maintainer of Compress::LZ4Frame (perl binding for LZ4) and need your help :-)
As far as I see, the lz4 tools generate frames, where the content size header is 0 (unknown).
The current stable version of Compress::LZ4Frame requires a known content size,
which works for data that was compressed with it, but may be bad it the header is 0 :/
I implemented the decompression when the content size is unknown.
Now for testing I generated a text file and compressed it using the LZ4 program yielding the t/lorem.txt and t/lorem.txt.lz4
I wrote a little test loading the two files, decompressing the compressed one and then comparing the original to the decompressed version.
Funnily now the code errors before I even get to check if the content size header is 0.
LZ4F_getFrameInfo returns ERROR_frameType_incomplete (master branch) and ERROR_frameType_unknown (dev branch)
which is rather confusing.
Using the LZ4 tools I am able to decompress the .lz4 file.
Currently I am stuck, so if someone could take a look at the code that would be great.
The relevant parts are CompressLZ4Frame.xs (C) and t/01-compression.t (Perl, just in case I have a bug in the testing code... you never know O.o)
As for the XS file the interesting part is the decompress_single_frame function directly at the beginning of the file.
It is called repeatedly for concatenated LZ4 frames and so far works for normal data.
Only problem is stuff compressed with the tools :/
In line 30 the frame info is read which returns the errors above (currently ERROR_frameType_unknown, because I replaced the LZ4 sources with current versions from the dev branch).
Thanks in advance
Felix