LZW encoder and decoder.
This crate provides a Encoder and Decoder to compress and decompress LZW data. This particular implementation provides the GIF and TIFF variation, as well as the original fixed 12 bit LZW variation.
It's fast, and use limited memory to do so: the decoder only uses the stack.
It works with any [std::io::Read] and [std::io::Write].
Examples
Encoding GIF data
use ;
let data = ;
let mut compressed = vec!;
let mut decompressed = vec!;
encode.expect;
assert_eq!;
decode.expect;
assert_eq!;
Compressing a file using the TIFF variation
use TiffStyleEncoder;
use ;
let path = new
.parent
.expect
.join;
let output_file = sink; // Let's pretend this is a file.
let data = new;
encode.expect;