airlift / aircompressor

A port of Snappy, LZO, LZ4, and Zstandard to Java
Apache License 2.0
576 stars 115 forks source link

Request: Generic Decompressor for all algos based on magic number header #202

Open gabrieljones opened 5 months ago

gabrieljones commented 5 months ago

A decompressor that can detect and handle any of the supported algorithms.

Algo Magic Number Source
ZStd 28 b5 2f fd https://en.wikipedia.org/wiki/Zstd
LZ4 04 22 4d 18 https://en.wikipedia.org/wiki/LZ4_(compression_algorithm)
Snappy ff 06 00 00 73 4e 61 50 70 59 https://en.wikipedia.org/wiki/Snappy_(compression)
LZO ??? https://github.com/mirror/lzop/blob/master/doc/magic
GZIP 1f 8b https://en.wikipedia.org/wiki/Gzip
Deflate ??? https://en.wikipedia.org/wiki/Deflate
BZip2 BZh https://en.wikipedia.org/wiki/Bzip2
gabrieljones commented 2 months ago

@wendigo @dain If I made a PR that added this capability would you consider it?