DecoderFallbackBuffer.Fallback(Byte[], Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
When overridden in a derived class, prepares the fallback buffer to handle the specified input byte sequence.
public:
abstract bool Fallback(cli::array <System::Byte> ^ bytesUnknown, int index);
public abstract bool Fallback (byte[] bytesUnknown, int index);
abstract member Fallback : byte[] * int -> bool
Public MustOverride Function Fallback (bytesUnknown As Byte(), index As Integer) As Boolean
Parameters
- bytesUnknown
- Byte[]
An input array of bytes.
- index
- Int32
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, 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. If called in an exception fallback handler, the Fallback method throws an exception because it does not process individual bytes.
Notes to Implementers
You can choose to ignore the index
parameter if you don't expect any previous fallback to be remaining in the buffer. Otherwise, index
is the index position in the bytesUnknown
array.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應