A stream encoder: writes data in the encoding a Filter entry names, so that the filter of that name decodes it back. The
encoder extension point, separate from the decoding contract IStreamFilter so that a decode-only filter never has to
encode: every engine holds one encoder per name, the managed defaults unless UseStreamEncoder(IStreamEncoder) replaced
or added one.
public interface IStreamEncoder
ISO 32000-2 §7.4.1: a PDF writer may encode the data of a stream to compress it or to convert it to a portable ASCII
representation, or both. A document encodes a stream (EncodeStream(CosStream, ReadOnlySpan<Byte>, CompressionLevel)) by running the encoders its
Filter entry names in the reverse of decoding order, last name first, each over the previous one's output. The pipeline,
not the encoder, applies the predictor functions of §7.4.4.4 before any encoder named LZWDecode or FlateDecode
(a replacement for either gets them too and must not apply them itself); Crypt (§7.4.10) is never an encoder.
Thread safety: one instance serves every document of every thread of the engines it is registered with. An implementation keeps no state between calls.
Encoding is writing, not reading, so leniency does not apply: parameters an encoder cannot honour make it throw . Whatever an encoder writes decodes, through the filter of the same name and the same parameters, to exactly the data it was given, except for a lossy image encoder (DctEncoder, §7.4.8), whose output decodes to samples of the same size close to it.
kind:method, kind:property, kind:ctor. Press Esc to clear.NameGets the name of the filter that decodes what this encoder writes, such as FlateDecode: the key it is registered under.Encode(ReadOnlySpan<Byte>, IBufferWriter<Byte>, StreamEncoderContext)Encodes data and writes the result to output.