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

◆ GetChars() [4/6]

unsafe override int System.Text.ASCIIEncoding.GetChars ( byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex )
inlineinherited

Definition at line 316 of file ASCIIEncoding.cs.

317 {
318 if (bytes == null || chars == null)
319 {
320 ThrowHelper.ThrowArgumentNullException((bytes == null) ? ExceptionArgument.bytes : ExceptionArgument.chars, ExceptionResource.ArgumentNull_Array);
321 }
322 if ((byteIndex | byteCount) < 0)
323 {
324 ThrowHelper.ThrowArgumentOutOfRangeException((byteIndex < 0) ? ExceptionArgument.byteIndex : ExceptionArgument.byteCount, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum);
325 }
326 if (bytes.Length - byteIndex < byteCount)
327 {
328 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.bytes, ExceptionResource.ArgumentOutOfRange_IndexCountBuffer);
329 }
330 if ((uint)charIndex > (uint)chars.Length)
331 {
332 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.charIndex, ExceptionResource.ArgumentOutOfRange_Index);
333 }
334 fixed (byte* ptr = bytes)
335 {
336 fixed (char* ptr2 = chars)
337 {
338 return GetCharsCommon(ptr + byteIndex, byteCount, ptr2 + charIndex, chars.Length - charIndex);
339 }
340 }
341 }
unsafe int GetCharsCommon(byte *pBytes, int byteCount, char *pChars, int charCount)

References System.byteCount, System.byteIndex, System.bytes, System.charIndex, System.chars, System.Text.ASCIIEncoding.GetCharsCommon(), System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowArgumentOutOfRangeException().