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

◆ GetChars() [5/6]

unsafe override char[] System.Text.Latin1Encoding.GetChars ( byte[] bytes,
int index,
int count )
inlinevirtualinherited

Reimplemented from System.Text.Encoding.

Definition at line 353 of file Latin1Encoding.cs.

354 {
355 if (bytes == null)
356 {
357 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.bytes, ExceptionResource.ArgumentNull_Array);
358 }
359 if ((index | count) < 0)
360 {
361 ThrowHelper.ThrowArgumentOutOfRangeException((index < 0) ? ExceptionArgument.index : ExceptionArgument.count, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum);
362 }
363 if (bytes.Length - index < count)
364 {
365 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.bytes, ExceptionResource.ArgumentOutOfRange_IndexCountBuffer);
366 }
367 char[] array = new char[count];
368 fixed (byte* ptr = bytes)
369 {
370 fixed (char* pChars = array)
371 {
372 GetCharsCommon(ptr + index, count, pChars, array.Length);
373 }
374 }
375 return array;
376 }
unsafe int GetCharsCommon(byte *pBytes, int byteCount, char *pChars, int charCount)

References System.array, System.bytes, System.count, System.Text.Latin1Encoding.GetCharsCommon(), System.index, System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowArgumentOutOfRangeException().