This release changes the handling of errors for block decompression when uncompressed_size > 0
. In this case, we no longer check that the uncompressed data has exactly the size specified by uncompressed_size
: this argument is now used as an upper bound.
In addition, we introduce a new exception: LZ4BlockError which is raised whenever the LZ4 library fails.
These two changes together allow "guessing" of the uncompressed data size: simply set uncompressed_size
to a number and try decompress
, and catch LZ4BlockError
. If LZ4BlockError
is raised, increase uncompressed_size
and try again.
See the documentation for more details and examples.