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

◆ GetByteCount() [4/5]

unsafe override int System.Text.EncoderNLS.GetByteCount ( char[] chars,
int index,
int count,
bool flush )
inlineinherited

Definition at line 71 of file EncoderNLS.cs.

72 {
73 if (chars == null)
74 {
75 throw new ArgumentNullException("chars", System.SR.ArgumentNull_Array);
76 }
77 if (index < 0 || count < 0)
78 {
79 throw new ArgumentOutOfRangeException((index < 0) ? "index" : "count", System.SR.ArgumentOutOfRange_NeedNonNegNum);
80 }
81 if (chars.Length - index < count)
82 {
83 throw new ArgumentOutOfRangeException("chars", System.SR.ArgumentOutOfRange_IndexCountBuffer);
84 }
85 if (chars.Length == 0)
86 {
87 chars = new char[1];
88 }
89 int num = -1;
90 fixed (char* ptr = &chars[0])
91 {
92 num = GetByteCount(ptr + index, count, flush);
93 }
94 return num;
95 }
static string ArgumentOutOfRange_IndexCountBuffer
Definition SR.cs:78
static string ArgumentNull_Array
Definition SR.cs:24
Definition SR.cs:7
unsafe override int GetByteCount(char[] chars, int index, int count, bool flush)
Definition EncoderNLS.cs:56

References System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_IndexCountBuffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.chars, System.count, System.Runtime.Serialization.Dictionary, System.Text.EncoderNLS.GetByteCount(), and System.index.