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

◆ Convert() [4/5]

unsafe override void System.Text.DecoderDBCS.Convert ( byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex,
int charCount,
bool flush,
out int bytesUsed,
out int charsUsed,
out bool completed )
inlinevirtual

Reimplemented from System.Text.Decoder.

Definition at line 203 of file DecoderDBCS.cs.

204 {
205 if (bytes == null || chars == null)
206 {
207 throw new ArgumentNullException((bytes == null) ? "bytes" : "chars", System.SR.ArgumentNull_Array);
208 }
209 if (byteIndex < 0 || byteCount < 0)
210 {
211 throw new ArgumentOutOfRangeException((byteIndex < 0) ? "byteIndex" : "byteCount", System.SR.ArgumentOutOfRange_NeedNonNegNum);
212 }
213 if (charIndex < 0 || charCount < 0)
214 {
215 throw new ArgumentOutOfRangeException((charIndex < 0) ? "charIndex" : "charCount", System.SR.ArgumentOutOfRange_NeedNonNegNum);
216 }
217 if (bytes.Length - byteIndex < byteCount)
218 {
219 throw new ArgumentOutOfRangeException("bytes", System.SR.ArgumentOutOfRange_IndexCountBuffer);
220 }
221 if (chars.Length - charIndex < charCount)
222 {
223 throw new ArgumentOutOfRangeException("chars", System.SR.ArgumentOutOfRange_IndexCountBuffer);
224 }
225 if (charCount == 0 || (bytes.Length == 0 && (_leftOverLeadByte == 0 || !flush)))
226 {
227 bytesUsed = 0;
228 charsUsed = 0;
229 completed = false;
230 return;
231 }
232 fixed (char* ptr2 = &chars[0])
233 {
234 fixed (byte* ptr = bytes)
235 {
236 Unsafe.SkipInit(out byte b);
237 byte* bytes2 = ((ptr == null) ? (&b) : (ptr + byteIndex));
238 Convert(bytes2, byteCount, ptr2 + charIndex, charCount, flush, out bytesUsed, out charsUsed, out completed);
239 }
240 }
241 }
static string ArgumentOutOfRange_IndexCountBuffer
Definition SR.cs:78
Definition SR.cs:7
unsafe override 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)

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