public LZWCompressor(Stream outp, int codeSize, bool TIFF)
{
bf_ = new BitFile(outp, !TIFF); // set flag for GIF as NOT tiff
codeSize_ = codeSize;
tiffFudge_ = TIFF;
clearCode_ = 1 << codeSize_;
endOfInfo_ = clearCode_ + 1;
numBits_ = codeSize_ + 1;
limit_ = (1 << numBits_) - 1;
if (tiffFudge_)
--limit_;
prefix_ = -1;
lzss_ = new LZWStringTable();
lzss_.ClearTable(codeSize_);
bf_.WriteBits(clearCode_, numBits_);
}