System.Text.EncoderFallback.CreateFallbackBuffer Method

When overridden in a derived class, initializes a new instance of the System.Text.EncoderFallbackBuffer class.

Syntax

public abstract EncoderFallbackBuffer CreateFallbackBuffer ()

Returns

An object that provides a fallback buffer for an encoder.

Remarks

This method returns an object derived from System.Text.EncoderFallbackBuffer that is responsible for performing the fallback operation. For example, of the predefined System.Text.EncoderFallback implementations in the .NET Framework, the EncoderReplacementFallback.CreateFallbackBuffer method returns an System.Text.EncoderReplacementFallbackBuffer object, and the EncoderExceptionFallback.CreateFallbackBuffer method returns an System.Text.EncoderExceptionFallbackBuffer object.

The EncoderFallback.CreateFallbackBuffer method is called by an encoder when it encounters the first character that it is unable to encode. The System.Text.EncoderFallbackBuffer object returned by this method provides the fallback implementation and is responsible for returning the byte array that replaces the character or characters that could not be encoded.

Requirements

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