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

◆ GetCharCount() [4/5]

unsafe override int System.Text.UnicodeEncoding.GetCharCount ( byte[] bytes,
int index,
int count )
inline

Definition at line 235 of file UnicodeEncoding.cs.

236 {
237 if (bytes == null)
238 {
239 throw new ArgumentNullException("bytes", SR.ArgumentNull_Array);
240 }
241 if (index < 0 || count < 0)
242 {
243 throw new ArgumentOutOfRangeException((index < 0) ? "index" : "count", SR.ArgumentOutOfRange_NeedNonNegNum);
244 }
245 if (bytes.Length - index < count)
246 {
247 throw new ArgumentOutOfRangeException("bytes", SR.ArgumentOutOfRange_IndexCountBuffer);
248 }
249 if (count == 0)
250 {
251 return 0;
252 }
253 fixed (byte* ptr = bytes)
254 {
255 return GetCharCount(ptr + index, count, null);
256 }
257 }
unsafe override int GetCharCount(byte[] bytes, int index, int count)

References System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_IndexCountBuffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.bytes, System.count, System.Text.UnicodeEncoding.GetCharCount(), and System.index.

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