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

◆ GetCharCount() [4/5]

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

Definition at line 324 of file UTF8Encoding.cs.

325 {
326 if (bytes == null)
327 {
328 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.bytes, ExceptionResource.ArgumentNull_Array);
329 }
330 if ((index | count) < 0)
331 {
332 ThrowHelper.ThrowArgumentOutOfRangeException((index < 0) ? ExceptionArgument.index : ExceptionArgument.count, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum);
333 }
334 if (bytes.Length - index < count)
335 {
336 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.bytes, ExceptionResource.ArgumentOutOfRange_IndexCountBuffer);
337 }
338 fixed (byte* ptr = bytes)
339 {
340 return GetCharCountCommon(ptr + index, count);
341 }
342 }
unsafe int GetCharCountCommon(byte *pBytes, int byteCount)

References System.bytes, System.count, System.Text.UTF8Encoding.GetCharCountCommon(), System.index, System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowArgumentOutOfRangeException().