System.Text.DecoderExceptionFallbackBuffer.Fallback Method

Throws System.Text.DecoderFallbackException when the input byte sequence cannot be decoded. The nominal return value is not used.

Syntax

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

Parameters

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

Returns

None. No value is returned because the DecoderExceptionFallbackBuffer.Fallback(Byte[], int) method always throws an exception.

The nominal return value is true. A return value is defined, although it is unchanging, because this method implements an abstract method.

Remarks

The erload:System.Text.Encoding.GetBytes and erload:System.Text.Decoder.Convert methods call DecoderExceptionFallbackBuffer.Fallback(Byte[], int) if they encounter an unknown byte in their input. In response, the DecoderExceptionFallbackBuffer.Fallback(Byte[], int) method always throws System.Text.DecoderFallbackException and displays the input data. The DecoderExceptionFallbackBuffer.Fallback(Byte[], int) method nominally indicates whether an exception is thrown if an input byte sequence cannot be decoded.

Requirements

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