Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ GetChars() [4/6]

unsafe override int System.Text.UTF8Encoding.GetChars ( byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex )
inlineinherited

Definition at line 366 of file UTF8Encoding.cs.

367 {
368 if (bytes == null || chars == null)
369 {
370 ThrowHelper.ThrowArgumentNullException((bytes == null) ? ExceptionArgument.bytes : ExceptionArgument.chars, ExceptionResource.ArgumentNull_Array);
371 }
372 if ((byteIndex | byteCount) < 0)
373 {
374 ThrowHelper.ThrowArgumentOutOfRangeException((byteIndex < 0) ? ExceptionArgument.byteIndex : ExceptionArgument.byteCount, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum);
375 }
376 if (bytes.Length - byteIndex < byteCount)
377 {
378 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.bytes, ExceptionResource.ArgumentOutOfRange_IndexCountBuffer);
379 }
380 if ((uint)charIndex > (uint)chars.Length)
381 {
382 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.charIndex, ExceptionResource.ArgumentOutOfRange_Index);
383 }
384 fixed (byte* ptr = bytes)
385 {
386 fixed (char* ptr2 = chars)
387 {
388 return GetCharsCommon(ptr + byteIndex, byteCount, ptr2 + charIndex, chars.Length - charIndex);
389 }
390 }
391 }
unsafe int GetCharsCommon(byte *pBytes, int byteCount, char *pChars, int charCount)

References System.byteCount, System.byteIndex, System.bytes, System.charIndex, System.chars, System.Text.UTF8Encoding.GetCharsCommon(), System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowArgumentOutOfRangeException().

Referenced by System.Xml.XmlConverter.ToChars().