pub fn decompress(
        &mut self,
        input: &[u8],
        output: &mut [u8],
    ) -> Result<usize> {
        if input.is_empty() {
            return Err(Error::Empty);
        }
        let hdr = Header::read(input)?;
        if hdr.decompress_len > output.len() {
            return Err(Error::BufferTooSmall {
                given: output.len() as u64,
                min: hdr.decompress_len as u64,
            });
        }
        let dst = &mut output[..hdr.decompress_len];
        let mut dec =
            Decompress { src: &input[hdr.len..], s: 0, dst: dst, d: 0 };
        dec.decompress()?;
        Ok(dec.dst.len())
    }
Decompresses all bytes in `input` into `output`.

`input` must be a sequence of bytes returned by a conforming Snappy
compressor.

The size of `output` must be large enough to hold all decompressed
bytes from the `input`. The size required can be queried with the
`decompress_len` function.

On success, this returns the number of bytes written to `output`.

# Errors

This method returns an error in the following circumstances:

* Invalid compressed Snappy data was seen.
* The total space required for decompression exceeds `2^32 - 1`.
* `output` has length less than `decompress_len(input)`.
src/decompress.rs