Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetChars() [1/4]

virtual unsafe int System.Text.Decoder.GetChars ( byte * bytes,
int byteCount,
char * chars,
int charCount,
bool flush )
inlinevirtualinherited

Reimplemented in System.Text.DecoderDBCS, System.Text.DecoderDBCS, System.Text.DecoderNLS, System.Text.Encoding.DefaultDecoder, and System.Text.DecoderNLS.

Definition at line 103 of file Decoder.cs.

104 {
105 if (chars == null || bytes == null)
106 {
107 throw new ArgumentNullException((chars == null) ? "chars" : "bytes", SR.ArgumentNull_Array);
108 }
109 if (byteCount < 0 || charCount < 0)
110 {
111 throw new ArgumentOutOfRangeException((byteCount < 0) ? "byteCount" : "charCount", SR.ArgumentOutOfRange_NeedNonNegNum);
112 }
113 byte[] array = new byte[byteCount];
114 for (int i = 0; i < byteCount; i++)
115 {
116 array[i] = bytes[i];
117 }
118 char[] array2 = new char[charCount];
119 int chars2 = GetChars(array, 0, byteCount, array2, 0, flush);
120 if (chars2 < charCount)
121 {
122 charCount = chars2;
123 }
124 for (int i = 0; i < charCount; i++)
125 {
126 chars[i] = array2[i];
127 }
128 return charCount;
129 }
int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)

References System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.array, System.byteCount, System.bytes, System.charCount, System.chars, and System.Text.Decoder.GetChars().