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

◆ GetMaxByteCount()

override int System.Text.UTF8Encoding.GetMaxByteCount ( int charCount)
inlineinherited

Definition at line 532 of file UTF8Encoding.cs.

533 {
534 if (charCount < 0)
535 {
536 throw new ArgumentOutOfRangeException("charCount", SR.ArgumentOutOfRange_NeedNonNegNum);
537 }
538 long num = (long)charCount + 1L;
539 if (base.EncoderFallback.MaxCharCount > 1)
540 {
541 num *= base.EncoderFallback.MaxCharCount;
542 }
543 num *= 3;
544 if (num > int.MaxValue)
545 {
546 throw new ArgumentOutOfRangeException("charCount", SR.ArgumentOutOfRange_GetByteCountOverflow);
547 }
548 return (int)num;
549 }

References System.SR.ArgumentOutOfRange_GetByteCountOverflow, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.charCount, and System.L.