This documentation is archived and is not being maintained.

DecoderFallbackBuffer.Fallback Method

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

Namespace:  System.Text
Assembly:  mscorlib (in mscorlib.dll)

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


Type: System.Byte[]
An input array of bytes.
Type: System.Int32
The index position of a byte in bytesUnknown.

Return Value

Type: System.Boolean
true if the fallback buffer can process bytesUnknown; false if the fallback buffer ignores bytesUnknown.

The Encoding.GetChars(Byte[]), Encoding.GetString(Byte[]), and Decoder.Convert methods call Fallback 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 GetNextChar method to obtain each character of the fallback buffer. Because it does not process individual bytes, the Fallback method in an exception fallback handler throws an exception.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.