mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:48:11 +00:00
LibCompress: Implement DEFLATE properly.
Now we have an actual stream implementation that can read arbitrary (dynamic codes aren't supported yet) deflate encoded data. Even if the blocks are really large. And all of that happens with a single buffer of 32KiB. DEFLATE is amazing!
This commit is contained in:
parent
71cbf72e8a
commit
7c53f14bbc
5 changed files with 417 additions and 504 deletions
|
@ -26,18 +26,25 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Span.h>
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Vector.h>
|
||||
|
||||
namespace Compress {
|
||||
|
||||
class Zlib {
|
||||
public:
|
||||
Zlib(ReadonlyBytes data);
|
||||
|
||||
Vector<u8> decompress();
|
||||
ByteBuffer decompress();
|
||||
u32 checksum();
|
||||
|
||||
static ByteBuffer decompress_all(ReadonlyBytes bytes)
|
||||
{
|
||||
Zlib zlib { bytes };
|
||||
return zlib.decompress();
|
||||
}
|
||||
|
||||
private:
|
||||
u8 m_compression_method;
|
||||
u8 m_compression_info;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue