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

◆ GetMaxByteCount()

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

Definition at line 1139 of file UnicodeEncoding.cs.

1140 {
1141 if (charCount < 0)
1142 {
1143 throw new ArgumentOutOfRangeException("charCount", SR.ArgumentOutOfRange_NeedNonNegNum);
1144 }
1145 long num = (long)charCount + 1L;
1146 if (base.EncoderFallback.MaxCharCount > 1)
1147 {
1148 num *= base.EncoderFallback.MaxCharCount;
1149 }
1150 num <<= 1;
1151 if (num > int.MaxValue)
1152 {
1153 throw new ArgumentOutOfRangeException("charCount", SR.ArgumentOutOfRange_GetByteCountOverflow);
1154 }
1155 return (int)num;
1156 }

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