Module snap::raw

source ·
Expand description

This module provides a raw Snappy encoder and decoder.

A raw Snappy encoder/decoder can only compress/decompress a fixed amount of data at a time. For this reason, this module is lower level and more difficult to use than the higher level streaming readers and writers exposed as part of the read and write modules.

Generally, one only needs to use the raw format if some other source is generating raw Snappy compressed data and you have no choice but to do the same. Otherwise, the Snappy frame format should probably always be preferred.

Structs

Decoder is a raw decoder for decompressing bytes in the Snappy format.
Encoder is a raw encoder for compressing bytes in the Snappy format.

Functions

Returns the decompressed size (in bytes) of the compressed bytes given.
Returns the maximum compressed size given the uncompressed size.