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

◆ GetChars() [6/7]

unsafe override int System.Text.DecoderDBCS.GetChars ( byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex,
bool flush )
inlinevirtual

Reimplemented from System.Text.Decoder.

Definition at line 127 of file DecoderDBCS.cs.

128 {
129 if (bytes == null || chars == null)
130 {
131 throw new ArgumentNullException((bytes == null) ? "bytes" : "chars", System.SR.ArgumentNull_Array);
132 }
133 if (byteIndex < 0 || byteCount < 0)
134 {
135 throw new ArgumentOutOfRangeException((byteIndex < 0) ? "byteIndex" : "byteCount", System.SR.ArgumentOutOfRange_NeedNonNegNum);
136 }
137 if (bytes.Length - byteIndex < byteCount)
138 {
139 throw new ArgumentOutOfRangeException("bytes", System.SR.ArgumentOutOfRange_IndexCountBuffer);
140 }
141 if (charIndex < 0 || charIndex > chars.Length)
142 {
143 throw new ArgumentOutOfRangeException("charIndex", System.SR.ArgumentOutOfRange_Index);
144 }
145 if (chars.Length == 0)
146 {
147 return 0;
148 }
149 if (byteCount == 0 && (_leftOverLeadByte == 0 || !flush))
150 {
151 return 0;
152 }
153 fixed (char* ptr2 = &chars[0])
154 {
155 fixed (byte* ptr = bytes)
156 {
157 Unsafe.SkipInit(out byte b);
158 byte* bytes2 = ((ptr == null) ? (&b) : (ptr + byteIndex));
159 return GetChars(bytes2, byteCount, ptr2 + charIndex, chars.Length - charIndex, flush);
160 }
161 }
162 }
static string ArgumentOutOfRange_Index
Definition SR.cs:30
static string ArgumentOutOfRange_IndexCountBuffer
Definition SR.cs:78
Definition SR.cs:7
override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)

References System.Text.DecoderDBCS._leftOverLeadByte, System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_Index, System.SR.ArgumentOutOfRange_IndexCountBuffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.byteCount, System.byteIndex, System.bytes, System.charIndex, System.chars, and System.Text.DecoderDBCS.GetChars().