Is there an official (or common) file extension or suffix for deflated files?

Gzipped files usually end with .gz . But is there an official (or common) file extension or suffix for deflated files? I could not find.

+4
source share
1 answer

There is an extension specific to flash compression files (RFC-1951) zlib-wrapped (RFC-1950), which is ".zz". There is no extension for the compressed spray data (RFC-1951) that I know of. In general, raw deflation data is used only in the context of some other data stream or file format.

The Java documentation is not clear about what is being produced, but Deflater seems to produce zlib-wrapped deflation data by default if the nowrap boolean value is not true, in which case raw compressed data is created.

More background:

It is interesting to see that people tend to think that all of these formats can be interpreted by reading one of them, simply because the main compressed format (descent) is the same. This is not relevant. The gzip utility can read gzip-wrapped deflate data or single-user zip files (and some legacy formats not related to deflate), but not zlib or raw deflate. Info-ZIP unzip can only read the ZIP format, which can include data deflation as one of the compressed data formats (there are others). zlib is a library, not a utility, and provides direct support for reading and writing zlib format (a very compact shell with data deflation), gzip format and raw deflate format without a shell. The latter can be used by other utilities to process deflate data in other formats, such as ZIP. You can write your own zipper and unzipper with zlib to handle heavy lifting for compression and decompression (as well as crc calculations), but you will have to handle all the complexities of headers, trailers and central zip dictionaries. pigz can read gzip, one-time zip files and the zlib format (as well as the old compression format).

+8
source

Source: https://habr.com/ru/post/1402670/


All Articles