Export (0) Print
Expand All

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
)

Parameters

bytesUnknown
Type: System.Byte[]

An input array of bytes.

index
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, Encoding.GetString, 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.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft