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

◆ GetByteCount() [4/7]

unsafe override int System.Text.ASCIIEncoding.GetByteCount ( char[] chars,
int index,
int count )
inlineinherited

Definition at line 35 of file ASCIIEncoding.cs.

36 {
37 if (chars == null)
38 {
39 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.chars, ExceptionResource.ArgumentNull_Array);
40 }
41 if ((index | count) < 0)
42 {
43 ThrowHelper.ThrowArgumentOutOfRangeException((index < 0) ? ExceptionArgument.index : ExceptionArgument.count, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum);
44 }
45 if (chars.Length - index < count)
46 {
47 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.chars, ExceptionResource.ArgumentOutOfRange_IndexCountBuffer);
48 }
49 fixed (char* ptr = chars)
50 {
51 return GetByteCountCommon(ptr + index, count);
52 }
53 }
unsafe int GetByteCountCommon(char *pChars, int charCount)

References System.chars, System.count, System.Text.ASCIIEncoding.GetByteCountCommon(), System.index, System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowArgumentOutOfRangeException().