pub trait SharedBrotliDecoder {
// Required method
fn decode(
&self,
encoded: &[u8],
shared_dictionary: Option<&[u8]>,
max_uncompressed_length: usize,
) -> Result<Vec<u8>, DecodeError>;
}Expand description
A Shared Brotli Decoder.
Shared brotli (https://datatracker.ietf.org/doc/draft-vandevenne-shared-brotli-format/) is an extension of brotli to allow the decompression to include a shared dictionary.
Required Methods§
Sourcefn decode(
&self,
encoded: &[u8],
shared_dictionary: Option<&[u8]>,
max_uncompressed_length: usize,
) -> Result<Vec<u8>, DecodeError>
fn decode( &self, encoded: &[u8], shared_dictionary: Option<&[u8]>, max_uncompressed_length: usize, ) -> Result<Vec<u8>, DecodeError>
Decodes shared brotli encoded data using the optional shared dictionary.
The shared dictionary is a raw LZ77 style dictionary, see: https://datatracker.ietf.org/doc/html/draft-vandevenne-shared-brotli-format#section-3.2
Will fail if the decoded result will be greater than max_uncompressed_length. Any excess data in encoded after the encoded stream finishes is also considered an error.