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

◆ GetByteCount() [4/7]

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

Definition at line 90 of file EncodingNLS.cs.

91 {
92 if (chars == null)
93 {
94 throw new ArgumentNullException("chars", System.SR.ArgumentNull_Array);
95 }
96 if (index < 0 || count < 0)
97 {
98 throw new ArgumentOutOfRangeException((index < 0) ? "index" : "count", System.SR.ArgumentOutOfRange_NeedNonNegNum);
99 }
100 if (chars.Length - index < count)
101 {
102 throw new ArgumentOutOfRangeException("chars", System.SR.ArgumentOutOfRange_IndexCountBuffer);
103 }
104 if (chars.Length == 0)
105 {
106 return 0;
107 }
108 fixed (char* ptr = &chars[0])
109 {
110 return GetByteCount(ptr + index, count, null);
111 }
112 }
static string ArgumentOutOfRange_IndexCountBuffer
Definition SR.cs:78
static string ArgumentNull_Array
Definition SR.cs:24
Definition SR.cs:7
unsafe int GetByteCount(char *chars, int count, System.Text.EncoderNLS encoder)

References System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_IndexCountBuffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.chars, System.count, System.Text.EncodingNLS.GetByteCount(), and System.index.