If you run deflate with the Z_BLOCK parameter, the subsequent deflatePending call returns the number of bits that were not written to the output in the pointer, because the input data was not enough to form a full byte on the output. If you then add the next block of input data, then the above bits will be written. My question is: which side will they be written to byte? From low to high or from high to low? Confused link from an article about deflate in Wikipedia. The link is explained on the fingers, how the deflate sequence is parsed, and in particular it says that

all that is encoded by Huffman codes goes high bit forward or from right to left. The rest goes the low bit forward. those. high bit on the left.

Here is the link: http://compression.ru/download/articles/lz/mihalchik_deflate_decoding.html

  • I apologize, it is impossible to add adequate tags to the question with a reputation below 300. - user239133
  • Source codes are, on it it is possible to look at everything. Or even compile with your debug output. - PinkTux
  • Thanks, it helped. It turned out that in zlib there are tremendous comments, at least on what is in zlib.h. - user239133

0