System.Text.DecoderFallbackBuffer.Fallback Method

When overridden in a derived class, prepares the fallback buffer to handle the specified input byte sequence.

Syntax

public abstract bool Fallback (byte[] bytesUnknown, int index)

Parameters

bytesUnknown
An input array of bytes.
index
The index position of a byte in bytesUnknown.

Returns

true if the fallback buffer can process bytesUnknown; false if the fallback buffer ignores bytesUnknown.

Remarks

The Encoding.GetChars(Byte[]), Encoding.GetString(Byte[]), and erload:System.Text.Decoder.Convert methods call DecoderFallbackBuffer.Fallback(Byte[], int) if they encounter an unknown input byte sequence that cannot be decoded. A return value of true indicates that the fallback buffer can process the input byte sequence, which causes the calling method to call the DecoderFallbackBuffer.GetNextChar method to obtain each character of the fallback buffer. Because it does not process individual bytes, the DecoderFallbackBuffer.Fallback(Byte[], int) method in an exception fallback handler throws an exception.

Requirements

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