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