Gzip
Struct · namespace System.Compression · Since 0.28
struct GzipDeflate data in the gzip container (RFC 1952, .gz files): a header, the data, its CRC-32 and its length.
Static methods
Section titled “Static methods”| Name | Description |
|---|---|
Compress |
data compressed with level 6. |
Decompress |
The bytes of the gzip data data (the first member); the CRC-32 and the length are checked. |
Compress
Section titled “Compress”static uint8[] Compress(ReadOnlySlice<uint8> data)data compressed with level 6.
static uint8[] Compress(ReadOnlySlice<uint8> data, int level)data compressed with level (0 to 9, see Deflate.Compress). The header has no file name and no time.
Panics when level is not 0 to 9.
Decompress
Section titled “Decompress”static CompressionError<uint8[]> Decompress(ReadOnlySlice<uint8> data)The bytes of the gzip data data (the first member); the CRC-32 and the length are checked.
Errors
CompressionError.InvalidData: the header is not one of gzip, or the deflate data is not valid.CompressionError.Truncated:dataends before the end of the stream or its trailer.CompressionError.ChecksumMismatch: the CRC-32 or the length does not match.