The LZW compression class i mplemented as a fixed length code which you can specify, the huffman algorithm implementation encodes a byte into a variable length bit array. Both of them can work with streams