mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 20:57:44 +00:00
LibCompress: Add Zlib header structure
This commit is contained in:
parent
f33979a753
commit
20575ea1f3
1 changed files with 26 additions and 0 deletions
|
@ -13,6 +13,32 @@
|
|||
|
||||
namespace Compress {
|
||||
|
||||
enum class ZlibCompressionMethod : u8 {
|
||||
Deflate = 8,
|
||||
};
|
||||
|
||||
enum class ZlibCompressionLevel : u8 {
|
||||
Fastest,
|
||||
Fast,
|
||||
Default,
|
||||
Best,
|
||||
};
|
||||
|
||||
struct ZlibHeader {
|
||||
union {
|
||||
struct {
|
||||
ZlibCompressionMethod compression_method : 4;
|
||||
u8 compression_info : 4;
|
||||
|
||||
u8 check_bits : 5;
|
||||
bool present_dictionary : 1;
|
||||
ZlibCompressionLevel compression_level : 2;
|
||||
};
|
||||
NetworkOrdered<u16> as_u16;
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(ZlibHeader) == sizeof(u16));
|
||||
|
||||
class Zlib {
|
||||
public:
|
||||
Optional<ByteBuffer> decompress();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue