Pierre Neidhardt wrote:
When the byte count of written data is equal to the size of the input
chunk, we have a guarantee that the result is complete (i.e. not
truncated), right?

It means that you have written all the chunk to lzlib. It does not mean that lzlib has produced all the output nor that you have read all the output from lzlib.


Also, is there a different between
    LZ_compress_finished(...) == 1
and
    LZ_compress_read() == 0

A world of difference. 'LZ_compress_read() == 0' means nothing:

-------------------------------------------------------------------
http://www.nongnu.org/lzip/manual/lzlib_manual.html#Compression-functions
The 'LZ_compress_read' function reads up to size bytes from the stream pointed to by encoder, storing the results in buffer.

The return value is the number of bytes actually read. This might be less than size; for example, if there aren't that many bytes left in the stream or if more bytes have to be yet written with the 'LZ_compress_write' function. Note that reading less than size bytes is not an error.
-------------------------------------------------------------------

For example, the member trailer is not produced until LZ_compress_finish is called, and is not guaranteed to have been read until 'LZ_compress_finished() == 1'.

_______________________________________________
Lzip-bug mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lzip-bug

Reply via email to