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

◆ GetMaxByteCount()

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

Definition at line 471 of file ISCIIEncoding.cs.

472 {
473 if (charCount < 0)
474 {
475 throw new ArgumentOutOfRangeException("charCount", System.SR.ArgumentOutOfRange_NeedNonNegNum);
476 }
477 long num = (long)charCount + 1L;
478 if (base.EncoderFallback.MaxCharCount > 1)
479 {
480 num *= base.EncoderFallback.MaxCharCount;
481 }
482 num *= 4;
483 if (num > int.MaxValue)
484 {
485 throw new ArgumentOutOfRangeException("charCount", System.SR.ArgumentOutOfRange_GetByteCountOverflow);
486 }
487 return (int)num;
488 }
static string ArgumentOutOfRange_GetByteCountOverflow
Definition SR.cs:88
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
Definition SR.cs:7

References System.SR.ArgumentOutOfRange_GetByteCountOverflow, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.charCount, System.Runtime.Serialization.Dictionary, and System.L.