7 [__DynamicallyInvokable]
11 internal unsafe
byte* byteStart;
14 internal unsafe
char* charEnd;
18 [__DynamicallyInvokable]
21 [__DynamicallyInvokable]
30 [__DynamicallyInvokable]
31 public abstract bool Fallback(
byte[] bytesUnknown,
int index);
35 [__DynamicallyInvokable]
41 [__DynamicallyInvokable]
45 [__DynamicallyInvokable]
54 internal unsafe
void InternalReset()
61 internal unsafe
void InternalInitialize(
byte* byteStart,
char* charEnd)
63 this.byteStart = byteStart;
64 this.charEnd = charEnd;
68 internal unsafe
virtual bool InternalFallback(
byte[] bytes,
byte* pBytes, ref
char* chars)
70 if (
Fallback(bytes, (
int)(pBytes - byteStart - bytes.Length)))
77 if (
char.IsSurrogate(nextChar))
79 if (
char.IsHighSurrogate(nextChar))
83 throw new ArgumentException(Environment.GetResourceString(
"Argument_InvalidCharSequenceNoIndex"));
91 throw new ArgumentException(Environment.GetResourceString(
"Argument_InvalidCharSequenceNoIndex"));
106 throw new ArgumentException(Environment.GetResourceString(
"Argument_InvalidCharSequenceNoIndex"));
114 internal unsafe
virtual int InternalFallback(
byte[] bytes,
byte* pBytes)
116 if (
Fallback(bytes, (
int)(pBytes - byteStart - bytes.Length)))
123 if (
char.IsSurrogate(nextChar))
125 if (
char.IsHighSurrogate(nextChar))
129 throw new ArgumentException(Environment.GetResourceString(
"Argument_InvalidCharSequenceNoIndex"));
137 throw new ArgumentException(Environment.GetResourceString(
"Argument_InvalidCharSequenceNoIndex"));
146 throw new ArgumentException(Environment.GetResourceString(
"Argument_InvalidCharSequenceNoIndex"));
153 internal void ThrowLastBytesRecursive(
byte[] bytesUnknown)
155 StringBuilder stringBuilder =
new StringBuilder(bytesUnknown.Length * 3);
157 for (i = 0; i < bytesUnknown.Length && i < 20; i++)
159 if (stringBuilder.Length > 0)
161 stringBuilder.Append(
" ");
167 stringBuilder.Append(
" ...");
169 throw new ArgumentException(Environment.GetResourceString(
"Argument_RecursiveFallbackBytes", stringBuilder.ToString()),
"bytesUnknown");
173 [__DynamicallyInvokable]
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
abstract char GetNextChar()
When overridden in a derived class, retrieves the next character in the fallback buffer.
virtual void Reset()
Initializes all data and state information pertaining to this fallback buffer.
DecoderFallbackBuffer()
Initializes a new instance of the T:System.Text.DecoderFallbackBuffer class.
Provides a buffer that allows a fallback handler to return an alternate string to a decoder when it c...
abstract int Remaining
When overridden in a derived class, gets the number of characters in the current T:System....
abstract bool MovePrevious()
When overridden in a derived class, causes the next call to the M:System.Text.DecoderFallbackBuffer....
abstract bool Fallback(byte[] bytesUnknown, int index)
When overridden in a derived class, prepares the fallback buffer to handle the specified input byte s...
Provides information about a specific culture (called a locale for unmanaged code development)....