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

◆ GetChars() [4/6]

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

Definition at line 326 of file Latin1Encoding.cs.

327 {
328 if (bytes == null || chars == null)
329 {
330 ThrowHelper.ThrowArgumentNullException((bytes == null) ? ExceptionArgument.bytes : ExceptionArgument.chars, ExceptionResource.ArgumentNull_Array);
331 }
332 if ((byteIndex | byteCount) < 0)
333 {
334 ThrowHelper.ThrowArgumentOutOfRangeException((byteIndex < 0) ? ExceptionArgument.byteIndex : ExceptionArgument.byteCount, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum);
335 }
336 if (bytes.Length - byteIndex < byteCount)
337 {
338 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.bytes, ExceptionResource.ArgumentOutOfRange_IndexCountBuffer);
339 }
340 if ((uint)charIndex > (uint)chars.Length)
341 {
342 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.charIndex, ExceptionResource.ArgumentOutOfRange_Index);
343 }
344 fixed (byte* ptr = bytes)
345 {
346 fixed (char* ptr2 = chars)
347 {
348 return GetCharsCommon(ptr + byteIndex, byteCount, ptr2 + charIndex, chars.Length - charIndex);
349 }
350 }
351 }
unsafe int GetCharsCommon(byte *pBytes, int byteCount, char *pChars, int charCount)

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