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

◆ GetMaxCharCount()

override int System.Text.UTF8Encoding.GetMaxCharCount ( int byteCount)
inlineinherited

Definition at line 551 of file UTF8Encoding.cs.

552 {
553 if (byteCount < 0)
554 {
555 throw new ArgumentOutOfRangeException("byteCount", SR.ArgumentOutOfRange_NeedNonNegNum);
556 }
557 long num = (long)byteCount + 1L;
558 if (base.DecoderFallback.MaxCharCount > 1)
559 {
560 num *= base.DecoderFallback.MaxCharCount;
561 }
562 if (num > int.MaxValue)
563 {
564 throw new ArgumentOutOfRangeException("byteCount", SR.ArgumentOutOfRange_GetCharCountOverflow);
565 }
566 return (int)num;
567 }

References System.SR.ArgumentOutOfRange_GetCharCountOverflow, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.byteCount, and System.L.