5 ms·
> Some compression formats such as gzip support encoding streams. More accurately speaking gzip (and many other compressed file formats) has the file size info
by lifthrasiir 3y ago
> Some compression formats such as gzip support encoding streams.
More accurately speaking gzip (and many other compressed file formats) has the file size information, but that information should (or can, for others) be appended after the data. Protobuf doesn't have any such information, so a better analogue would be the DEFLATE compressed bytestream format.
- mxmlnkn 3y agoGzip in particular has more something akin to a size checksum appended at the end, i.e., decompressed size modulo 2^32. This is not very helpful, especially as the maximum compression ratio is ~1032, it means that this "size" could already overflow for a gzip file that is only 4 MiB in compressed size. https://stackoverflow.com/a/69353889/2191065 https://stackoverflow.com/a/69353889/2191065