DecoderExceptionFallbackBuffer.Fallback(Byte[], Int32) 方法

定义

当无法对输入字节序列解码时引发 DecoderFallbackExceptionThrows DecoderFallbackException when the input byte sequence cannot be decoded. 不使用名义返回值。The nominal return value is not used.

public:
 override bool Fallback(cli::array <System::Byte> ^ bytesUnknown, int index);
public override bool Fallback (byte[] bytesUnknown, int index);
override this.Fallback : byte[] * int -> bool
Public Overrides Function Fallback (bytesUnknown As Byte(), index As Integer) As Boolean

参数

bytesUnknown
Byte[]

字节的输入数组。An input array of bytes.

index
Int32

输入中字节的索引位置。The index position of a byte in the input.

返回

Boolean

无。None. 不返回值,因为 Fallback(Byte[], Int32) 方法始终引发异常。No value is returned because the Fallback(Byte[], Int32) method always throws an exception.

名义返回值为 trueThe nominal return value is true. 即使返回值是不变的,也仍会定义一个返回值,原因是此方法会实现一个抽象方法。A return value is defined, although it is unchanging, because this method implements an abstract method.

例外

此方法总是引发一个异常,该异常报告无法解码的输入字节的值和索引位置。This method always throws an exception that reports the value and index position of the input byte that cannot be decoded.

注解

GetBytes如果和 Convert 方法 Fallback 在输入中遇到未知字节,则调用。The GetBytes and Convert methods call Fallback if they encounter an unknown byte in their input. 作为响应, Fallback 方法始终引发 DecoderFallbackException 并显示输入数据。In response, the Fallback method always throws DecoderFallbackException and displays the input data. Fallback方法通常指示在无法对输入字节序列进行解码时是否引发异常。The Fallback method nominally indicates whether an exception is thrown if an input byte sequence cannot be decoded.

适用于