Hi Pierre, Pierre Neidhardt wrote:
(If you can't read Scheme, I can help, no problem.)
Thanks. I'm not a Scheme programmer.
1. When am I supposed to call lz_decompress_finish? In the above lzread!, you'll see it's commented and it seems to work nonetheless. If I uncomment it, it crashes.
You may call LZ_decompress_finish as many times as you wish, but never before all the compresed data has been written with LZ_decompress_write. If you call LZ_decompress_finish prematurely, lzlib will report truncated data. If you don't call it, a truncated member may not be detected.
2. It's unclear in the manual if the lz-decompress-read reads all the bytes that were written. Am I supposed to loop until no more bytes are read?
It can't be guaranteed that LZ_decompress_read reads all the bytes written because up to more than 7000 decompressed bytes can be produced for each compressed byte. You may either read in a loop or alternate write/read calls in a loop.
3. In both functions, should we *compress_write everything first, then *compress_read as much as we can? Or chain write-read calls like in bbexample.c?
Both ways work.
4. In lzwrite, is "written" the number of uncompressed bytes and "read" the number of compressed bytes?
Yes. Regards, Antonio. _______________________________________________ Lzip-bug mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lzip-bug
