10 [__DynamicallyInvokable]
23 [__DynamicallyInvokable]
26 [__DynamicallyInvokable]
31 [__DynamicallyInvokable]
38 if (m_fallbackBuffer !=
null && m_fallbackBuffer.
Remaining > 0)
43 m_fallbackBuffer =
null;
50 [__DynamicallyInvokable]
53 [__DynamicallyInvokable]
56 if (m_fallbackBuffer ==
null)
58 if (m_fallback !=
null)
67 return m_fallbackBuffer;
71 internal bool InternalHasFallbackBuffer => m_fallbackBuffer !=
null;
75 info.AddValue(
"m_fallback", m_fallback);
79 [__DynamicallyInvokable]
86 [__DynamicallyInvokable]
89 byte[] bytes =
new byte[0];
90 char[] chars =
new char[
GetCharCount(bytes, 0, 0, flush:
true)];
91 GetChars(bytes, 0, 0, chars, 0, flush:
true);
92 if (m_fallbackBuffer !=
null)
94 m_fallbackBuffer.
Reset();
110 [__DynamicallyInvokable]
111 public abstract int GetCharCount(
byte[] bytes,
int index,
int count);
128 [__DynamicallyInvokable]
129 public virtual int GetCharCount(
byte[] bytes,
int index,
int count,
bool flush)
147 [CLSCompliant(
false)]
149 public unsafe
virtual int GetCharCount(
byte* bytes,
int count,
bool flush)
159 byte[] array =
new byte[count];
160 for (
int i = 0; i < count; i++)
185 [__DynamicallyInvokable]
186 public abstract int GetChars(
byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex);
208 [__DynamicallyInvokable]
209 public virtual int GetChars(
byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex,
bool flush)
211 return GetChars(bytes, byteIndex, byteCount, chars, charIndex);
232 [CLSCompliant(
false)]
234 public unsafe
virtual int GetChars(
byte* bytes,
int byteCount,
char* chars,
int charCount,
bool flush)
236 if (chars ==
null || bytes ==
null)
240 if (byteCount < 0 || charCount < 0)
244 byte[] array =
new byte[byteCount];
245 for (
int i = 0; i < byteCount; i++)
249 char[] array2 =
new char[charCount];
250 int chars2 =
GetChars(array, 0, byteCount, array2, 0, flush);
251 if (chars2 < charCount)
255 for (
int i = 0; i < charCount; i++)
257 chars[i] = array2[i];
282 [__DynamicallyInvokable]
283 public virtual void Convert(
byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex,
int charCount,
bool flush, out
int bytesUsed, out
int charsUsed, out
bool completed)
285 if (bytes ==
null || chars ==
null)
289 if (byteIndex < 0 || byteCount < 0)
293 if (charIndex < 0 || charCount < 0)
297 if (bytes.Length - byteIndex < byteCount)
301 if (chars.Length - charIndex < charCount)
305 for (bytesUsed = byteCount; bytesUsed > 0; bytesUsed /= 2)
307 if (
GetCharCount(bytes, byteIndex, bytesUsed, flush) <= charCount)
309 charsUsed =
GetChars(bytes, byteIndex, bytesUsed, chars, charIndex, flush);
310 completed = (bytesUsed == byteCount && (m_fallbackBuffer ==
null || m_fallbackBuffer.
Remaining == 0));
336 [CLSCompliant(
false)]
338 public unsafe
virtual void Convert(
byte* bytes,
int byteCount,
char* chars,
int charCount,
bool flush, out
int bytesUsed, out
int charsUsed, out
bool completed)
340 if (chars ==
null || bytes ==
null)
344 if (byteCount < 0 || charCount < 0)
348 for (bytesUsed = byteCount; bytesUsed > 0; bytesUsed /= 2)
352 charsUsed =
GetChars(bytes, bytesUsed, chars, charCount, flush);
353 completed = (bytesUsed == byteCount && (m_fallbackBuffer ==
null || m_fallbackBuffer.
Remaining == 0));
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
virtual int GetCharCount(byte[] bytes, int index, int count, bool flush)
When overridden in a derived class, calculates the number of characters produced by decoding a sequen...
DecoderFallback Fallback
Gets or sets a T:System.Text.DecoderFallback object for the current T:System.Text....
The exception that is thrown when the value of an argument is outside the allowable range of values a...
static DecoderFallback ReplacementFallback
Gets an object that outputs a substitute string in place of an input byte sequence that cannot be dec...
virtual void Reset()
Initializes all data and state information pertaining to this fallback buffer.
Provides information about, and means to manipulate, the current environment and platform....
Decoder()
Initializes a new instance of the T:System.Text.Decoder class.
abstract int GetCharCount(byte[] bytes, int index, int count)
When overridden in a derived class, calculates the number of characters produced by decoding a sequen...
Provides a buffer that allows a fallback handler to return an alternate string to a decoder when it c...
virtual unsafe void Convert(byte *bytes, int byteCount, char *chars, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed)
Converts a buffer of encoded bytes to UTF-16 encoded characters and stores the result in another buff...
virtual unsafe int GetChars(byte *bytes, int byteCount, char *chars, int charCount, bool flush)
When overridden in a derived class, decodes a sequence of bytes starting at the specified byte pointe...
Converts a sequence of encoded bytes into a set of characters.
abstract int Remaining
When overridden in a derived class, gets the number of characters in the current T:System....
Provides a failure-handling mechanism, called a fallback, for an encoded input byte sequence that can...
virtual void Reset()
When overridden in a derived class, sets the decoder back to its initial state.
abstract DecoderFallbackBuffer CreateFallbackBuffer()
When overridden in a derived class, initializes a new instance of the T:System.Text....
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
The exception that is thrown when one of the arguments provided to a method is not valid.
virtual void Convert(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed)
Converts an array of encoded bytes to UTF-16 encoded characters and stores the result in a character ...
DecoderFallbackBuffer FallbackBuffer
Gets the T:System.Text.DecoderFallbackBuffer object associated with the current T:System....
abstract int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
When overridden in a derived class, decodes a sequence of bytes from the specified byte array and any...
Specifies that the class can be serialized.
virtual unsafe int GetCharCount(byte *bytes, int count, bool flush)
When overridden in a derived class, calculates the number of characters produced by decoding a sequen...
virtual int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, bool flush)
When overridden in a derived class, decodes a sequence of bytes from the specified byte array and any...