Struct lzw::Encoder [−][src]
pub struct Encoder<W: BitWriter> { /* fields omitted */ }
LZW encoder using the algorithm of GIF files.
Methods
impl<W: BitWriter> Encoder<W>[src]
impl<W: BitWriter> Encoder<W>pub fn new(w: W, min_code_size: u8) -> Result<Encoder<W>>[src]
pub fn new(w: W, min_code_size: u8) -> Result<Encoder<W>>Creates a new LZW encoder.
Note: If min_code_size < 8 then Self::encode_bytes might panic when
the supplied data containts values that exceed 1 << min_code_size.
pub fn encode_bytes(&mut self, bytes: &[u8]) -> Result<()>[src]
pub fn encode_bytes(&mut self, bytes: &[u8]) -> Result<()>Compresses bytes and writes the result into the writer.
Panics
This function might panic if any of the input bytes exceeds 1 << min_code_size.
This cannot happen if min_code_size >= 8.