|
From: | Antonio Diaz Diaz |
Subject: | Re: [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix) |
Date: | Wed, 24 Apr 2019 18:14:59 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 |
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-functionsThe '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'.
[Prev in Thread] | Current Thread | [Next in Thread] |