The LZWDecode filter: Lempel-Ziv-Welch with 9- to 12-bit codes. Decode only.
public sealed class LzwDecodeFilter : IStreamFilter
ISO 32000-2 §7.4.4.1 to §7.4.4.3. Codes are read high-order bit first; 256 clears the table, 257 ends the data, 258 and up are
table entries. The code length grows to 10, 11 and 12 bits as the table reaches 512, 1024 and 2048 entries, one code early when
the EarlyChange parameter is 1 (the default) and only when necessary when it is 0 (Table 8). The predictor parameters of
Table 8 are applied after this filter by the pipeline (§7.4.4.4).
Lenient repairs, one diagnostic each: data that ends without the end-of-data code decodes to its end
(FilterDataTruncated); a code that is not yet in the table ends the data, and a full table without a clear code stops
growing (FilterDataInvalid); an EarlyChange other than 0 or 1 is read as 1 (DecodeParmsInvalid).
The table lives in arrays rented from the shared pool: no allocation per code.
kind:method, kind:property, kind:ctor. Press Esc to clear.NameGets the name the filter has in a Filter entry, such as FlateDecode: the key it is registered under.Decode(ReadOnlyMemory<Byte>, IBufferWriter<Byte>, FilterContext)Decodes encoded and writes the result to output.