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

◆ GetByteCount() [4/7]

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

Definition at line 111 of file UnicodeEncoding.cs.

112 {
113 if (chars == null)
114 {
115 throw new ArgumentNullException("chars", SR.ArgumentNull_Array);
116 }
117 if (index < 0 || count < 0)
118 {
119 throw new ArgumentOutOfRangeException((index < 0) ? "index" : "count", SR.ArgumentOutOfRange_NeedNonNegNum);
120 }
121 if (chars.Length - index < count)
122 {
123 throw new ArgumentOutOfRangeException("chars", SR.ArgumentOutOfRange_IndexCountBuffer);
124 }
125 if (count == 0)
126 {
127 return 0;
128 }
129 fixed (char* ptr = chars)
130 {
131 return GetByteCount(ptr + index, count, null);
132 }
133 }
unsafe override int GetByteCount(char[] chars, int index, int count)

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

Referenced by System.Text.UnicodeEncoding.GetByteCount(), System.Text.UnicodeEncoding.GetByteCount(), and System.Text.UnicodeEncoding.GetByteCount().