System.Text.DecoderFallbackBuffer Class

Provides a buffer that allows a fallback handler to return an alternate string to a decoder when it cannot decode an input byte sequence.

See Also: DecoderFallbackBuffer Members

Syntax

public abstract class DecoderFallbackBuffer

Remarks

An encoding defines a mapping between a Unicode character and an encoded sequence of bytes. A decoding operation, which converts an input byte sequence to an output character, fails if no mapping is defined for a particular byte sequence.

The .NET Framework provides a failure handling mechanism, called a fallback, if a conversion cannot be performed. All decoder fallback handlers must implement the following:

Fallbacks can use three strategies to handle conversion failures:

The buffer in a System.Text.DecoderFallbackBuffer implementation represents the entire string to be returned to the decoder in response to a decoder fallback. Generally, implementations also include state information, such as the index of the next character to return to the decoder and the number of remaining characters to be returned. Because System.Text.DecoderFallbackBuffer is an abstract class, it requires derived classes to implement the following members at a minimum:

Requirements

Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0