mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:38:10 +00:00
LibCompress: Return Optional from decompress_all method.
This commit is contained in:
parent
7e02cad476
commit
4af8eea56f
7 changed files with 22 additions and 20 deletions
|
@ -55,11 +55,17 @@ Zlib::Zlib(ReadonlyBytes data)
|
|||
m_data_bytes = data.slice(2, data.size() - 2 - 4);
|
||||
}
|
||||
|
||||
ByteBuffer Zlib::decompress()
|
||||
Optional<ByteBuffer> Zlib::decompress()
|
||||
{
|
||||
return DeflateDecompressor::decompress_all(m_data_bytes);
|
||||
}
|
||||
|
||||
Optional<ByteBuffer> Zlib::decompress_all(ReadonlyBytes bytes)
|
||||
{
|
||||
Zlib zlib { bytes };
|
||||
return zlib.decompress();
|
||||
}
|
||||
|
||||
u32 Zlib::checksum()
|
||||
{
|
||||
if (!m_checksum) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue