diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-03-03 23:54:07 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-03 23:42:32 +0100 |
commit | c12781a6a2dc074be249c21a31913d9b1458c1c9 (patch) | |
tree | 5bba232a939c08f4076f50800065e7ae2b7224ec /Userland/Libraries/LibCompress/Gzip.h | |
parent | 373a595c567cb467aa1f1c627dcfb4fac94dbf86 (diff) | |
download | serenity-c12781a6a2dc074be249c21a31913d9b1458c1c9.zip |
LibCore+LibHTTP+LibGfx: Switch to LibCompress
This commit removes the only 3rd party library (and its usages)
in serenity: puff, which is used for deflate decompression. and
replaces it with the existing original serenity implementation
in LibCompress. :^)
Diffstat (limited to 'Userland/Libraries/LibCompress/Gzip.h')
-rw-r--r-- | Userland/Libraries/LibCompress/Gzip.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCompress/Gzip.h b/Userland/Libraries/LibCompress/Gzip.h index fc8b92f38f..191cd6f905 100644 --- a/Userland/Libraries/LibCompress/Gzip.h +++ b/Userland/Libraries/LibCompress/Gzip.h @@ -31,6 +31,9 @@ namespace Compress { +constexpr u8 gzip_magic_1 = 0x1f; +constexpr u8 gzip_magic_2 = 0x8b; + class GzipDecompressor final : public InputStream { public: GzipDecompressor(InputStream&); @@ -43,6 +46,7 @@ public: bool unreliable_eof() const override; static Optional<ByteBuffer> decompress_all(ReadonlyBytes); + static bool is_likely_compressed(ReadonlyBytes bytes); private: struct [[gnu::packed]] BlockHeader { |