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

◆ GetMaxByteCount()

override int System.Text.UTF32Encoding.GetMaxByteCount ( int charCount)
inline

Definition at line 797 of file UTF32Encoding.cs.

798 {
799 if (charCount < 0)
800 {
801 throw new ArgumentOutOfRangeException("charCount", SR.ArgumentOutOfRange_NeedNonNegNum);
802 }
803 long num = (long)charCount + 1L;
804 if (base.EncoderFallback.MaxCharCount > 1)
805 {
806 num *= base.EncoderFallback.MaxCharCount;
807 }
808 num *= 4;
809 if (num > int.MaxValue)
810 {
811 throw new ArgumentOutOfRangeException("charCount", SR.ArgumentOutOfRange_GetByteCountOverflow);
812 }
813 return (int)num;
814 }

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