DecoderFallbackBuffer.Fallback(Byte[], Int32) Método
Definição
Quando substituído em uma classe derivada, prepara o buffer de fallback para manipular a sequência de bytes de entrada especificada.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
Parâmetros
- bytesUnknown
- Byte[]
Uma matriz de bytes de entrada.An input array of bytes.
- index
- Int32
A posição do índice de um byte em bytesUnknown.The index position of a byte in bytesUnknown.
Retornos
true se o buffer de fallback pode processar bytesUnknown; false se o buffer de fallback ignora bytesUnknown.true if the fallback buffer can process bytesUnknown; false if the fallback buffer ignores bytesUnknown.
Comentários
Os Encoding.GetChars Encoding.GetString métodos, e Decoder.Convert chamam Fallback se encontrarem uma sequência de bytes de entrada desconhecida que não pode ser decodificada.The Encoding.GetChars, Encoding.GetString, and Decoder.Convert methods call Fallback if they encounter an unknown input byte sequence that cannot be decoded. Um valor de retorno true indica que o buffer de fallback pode processar a sequência de bytes de entrada, o que faz com que o método de chamada chame o GetNextChar método para obter cada caractere do buffer de fallback.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. Como ele não processa bytes individuais, o Fallback método em um manipulador de fallback de exceção gera uma exceção.Because it does not process individual bytes, the Fallback method in an exception fallback handler throws an exception.