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

◆ GetMaxCharCount()

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

Definition at line 1158 of file UnicodeEncoding.cs.

1159 {
1160 if (byteCount < 0)
1161 {
1162 throw new ArgumentOutOfRangeException("byteCount", SR.ArgumentOutOfRange_NeedNonNegNum);
1163 }
1164 long num = (long)(byteCount >> 1) + (long)(byteCount & 1) + 1;
1165 if (base.DecoderFallback.MaxCharCount > 1)
1166 {
1167 num *= base.DecoderFallback.MaxCharCount;
1168 }
1169 if (num > int.MaxValue)
1170 {
1171 throw new ArgumentOutOfRangeException("byteCount", SR.ArgumentOutOfRange_GetCharCountOverflow);
1172 }
1173 return (int)num;
1174 }

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