Lyricdev
GitHub

struct Gzip

pub struct Gzip

The gzip format over bytes in memory.

Methods

pub static fn compress(bytes: Slice<uint8>, level: int = 6): uint8[] throws CompressError

Compresses bytes into a gzip file at level (0 to 9, -1 for the default 6).

Errors

Throws CompressError for a level outside -1 to 9.

pub static fn decompress(bytes: Slice<uint8>): uint8[] throws IoError

Decompresses gzip data; members in a row are returned as one.

Errors

Throws IoError { kind = .InvalidData } with a CompressError inside for data that is not gzip, or whose CRC-32 or size does not match.