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

◆ GetMaxCharCount()

override int System.Text.UTF32Encoding.GetMaxCharCount ( int byteCount)
inline

Definition at line 816 of file UTF32Encoding.cs.

817 {
818 if (byteCount < 0)
819 {
820 throw new ArgumentOutOfRangeException("byteCount", SR.ArgumentOutOfRange_NeedNonNegNum);
821 }
822 int num = byteCount / 2 + 2;
823 if (base.DecoderFallback.MaxCharCount > 2)
824 {
825 num *= base.DecoderFallback.MaxCharCount;
826 num /= 2;
827 }
828 if (num > int.MaxValue)
829 {
830 throw new ArgumentOutOfRangeException("byteCount", SR.ArgumentOutOfRange_GetCharCountOverflow);
831 }
832 return num;
833 }

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