0
votes

In RFC1951 DEFLATE spec, it is indicated that a compressed data block does not necessarily begin on a byte boundary. This also means that a block may not end on a byte boundary.

However, in RFC1950 ZLIB Compressed Data Format spec, it seems to indicate that the compressed data occupy an integral number of bytes. ZLIB uses "deflate" compression method when CM=8.

+=====================+---+---+---+---+
|...compressed data...|    ADLER32    |
+=====================+---+---+---+---+

How does it make sure the compressed data in zlib format with deflate compression are always an integral number of bytes while on the other hand the DEFLATE spec does not guarantee that the compressed block end on a byte boundary?

Does it mean that the compression must add some kind of dummy bits on the end of block if it is not ending on a byte boundary?

1

1 Answers

2
votes

Yes, there are zero bits appended to the last block as needed to get to a byte boundary.