| Define new LZ4BlockError exception and relax error checking
This commit changes the handling of errors for block decompression
when uncompressed_size > 0. In this case, we no longer check that
the uncompressedd 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.
| 7 年前 |
| Variable misspell fix
| 11 个月前 |