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

◆ GetCharCount() [4/5]

unsafe override int System.Text.EncodingNLS.GetCharCount ( byte[] bytes,
int index,
int count )
inlineinherited

Definition at line 220 of file EncodingNLS.cs.

221 {
222 if (bytes == null)
223 {
224 throw new ArgumentNullException("bytes", System.SR.ArgumentNull_Array);
225 }
226 if (index < 0 || count < 0)
227 {
228 throw new ArgumentOutOfRangeException((index < 0) ? "index" : "count", System.SR.ArgumentOutOfRange_NeedNonNegNum);
229 }
230 if (bytes.Length - index < count)
231 {
232 throw new ArgumentOutOfRangeException("bytes", System.SR.ArgumentOutOfRange_IndexCountBuffer);
233 }
234 if (bytes.Length == 0)
235 {
236 return 0;
237 }
238 fixed (byte* ptr = &bytes[0])
239 {
240 return GetCharCount(ptr + index, count, null);
241 }
242 }
static string ArgumentOutOfRange_IndexCountBuffer
Definition SR.cs:78
static string ArgumentNull_Array
Definition SR.cs:24
Definition SR.cs:7
unsafe int GetCharCount(byte *bytes, int count, System.Text.DecoderNLS decoder)

References System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_IndexCountBuffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.bytes, System.count, System.Text.EncodingNLS.GetCharCount(), and System.index.