objectLzwEncoder

Implements LZW compression encoding.

The algorithm is described in detail in the TIFF 6.0 spec, pages 58-61.

Each code written out uses 9-12 bits (which explains some the buffering we
have to do). Codes 0-255 are reserved for single bytes; code 256 is
reserved as CLEAR and code 257 is reserved as END. Thus, all multi-byte
codes span from 258 to 4095 (largest possible 12-bit value).