EvEmu
0.8.4
11 September 2021
|
#include "utils/Buffer.h"
Go to the source code of this file.
Functions | |
bool | IsDeflated (const Buffer &data) |
Checks whether given data is deflated. More... | |
bool | DeflateData (Buffer &data) |
Deflates given data. More... | |
bool | DeflateData (const Buffer &input, Buffer &output) |
Deflates given data. More... | |
bool | InflateData (Buffer &data) |
Inflates given data. More... | |
bool | InflateData (const Buffer &input, Buffer &output) |
Inflates given data. More... | |
Variables | |
const uint8 | DeflateHeaderByte |
bool DeflateData | ( | Buffer & | data | ) |
Deflates given data.
[in,out] | data | Data to be deflated, overwritten by result. |
true | Deflation ran successfully. |
false | Error occurred during deflation. |
Definition at line 37 of file Deflate.cpp.
References DeflateData().
Referenced by DeflateData(), MarshalDeflate(), and MailDB::SendMail().
Deflates given data.
[in] | input | Data to be deflated. |
[out] | output | Destination of deflated data. |
true | Deflation ran successfully. |
false | Error occurred during deflation. |
Definition at line 47 of file Deflate.cpp.
References Buffer::end(), Buffer::ResizeAt(), and Buffer::size().
bool InflateData | ( | Buffer & | data | ) |
Inflates given data.
[in,out] | data | Data to be inflated, overwritten by result. |
true | Inflation ran successfully. |
false | Failed to inflate data. |
Definition at line 68 of file Deflate.cpp.
References InflateData().
Referenced by InflateData(), and InflateUnmarshal().
Inflates given data.
One of the key things of the ZLIB stuff is that we 'sometimes' don't know the size of the uncompressed data. My idea is to fix this regarding the first phase of the parsing of the data (the parser) is to go trough a couple of output buffer size.
The first buffer size would be 2x the initial buffer size, implying that the compression ratio is about 50%. The second buffer size would be 4x the initial buffer size, implying that the compression ratio is about 75%. The third buffer size would be 8x the initial buffer size implying that the compression ratio is about 87.5%.
We would go on in this progress until we find buffer size big enough to hold uncompressed data.
This theory is really stupid because there is no way to actually know.
[in] | input | Data to be inflated. |
[out] | output | Destination for inflated data. |
true | Inflation ran successfully. |
false | Failed to inflate data. |
Definition at line 78 of file Deflate.cpp.
References Buffer::end(), Buffer::ResizeAt(), and Buffer::size().
bool IsDeflated | ( | const Buffer & | data | ) |
Checks whether given data is deflated.
[in] | data | Data to be checked. |
true | Data is deflated. |
false | Data is not deflated. |
Definition at line 32 of file Deflate.cpp.
References DeflateHeaderByte.
Referenced by InflateUnmarshal().
const uint8 DeflateHeaderByte |
Definition at line 30 of file Deflate.cpp.
Referenced by IsDeflated().