Open orangefour opened 6 years ago
After calling lzs_compress_incremental()
, examine which bit-flags are set in compress_params.status
(refer to LzsCompressStatus_t
). That will give you insight into the compression status.
Likewise for decompression, after calling lzs_decompress_incremental()
, examine decompress_params.status
bit-flags.
In this case, the call to lzs_compress_incremental()
returns with compress_params.status
set to LZS_C_STATUS_INPUT_FINISHED | LZS_C_STATUS_INPUT_STARVED
, indicating that all the input is used up. It is necessary to call the function a second time (again with the 2nd parameter set to true
), which flushes remaining data and sets the LZS_C_STATUS_END_MARKER
bit in the status.
Please see the branch issue-6
for example.
Thank you for explanation and example! I played around and noticed sometimes I need to call lzs_compress_incremental()
with 2nd parameter set to true
multiple times before all the data gets flushed. This might not be what the average user expects (yeah I am just nagging 😁)
I might be able to modify the function so that it completes outputting the end-marker in the first call to the function. I'll see what I can do.
This test compresses and decompresses text by using incremental versions of the functions.
Unfortunately after decompression, the last 3 words (
of the object.
) are missing.