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

◆ GetString() [3/4]

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

Reimplemented from System.Text.Encoding.

Definition at line 407 of file Latin1Encoding.cs.

408 {
409 if (bytes == null)
410 {
411 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.bytes, ExceptionResource.ArgumentNull_Array);
412 }
413 if ((index | count) < 0)
414 {
415 ThrowHelper.ThrowArgumentOutOfRangeException((index < 0) ? ExceptionArgument.index : ExceptionArgument.count, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum);
416 }
417 if (bytes.Length - index < count)
418 {
419 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.bytes, ExceptionResource.ArgumentOutOfRange_IndexCountBuffer);
420 }
421 return string.Create(count, (this, bytes, index), delegate(Span<char> chars, (Latin1Encoding encoding, byte[] bytes, int index) args)
422 {
423 fixed (byte* ptr = args.bytes)
424 {
425 fixed (char* pChars = chars)
426 {
427 args.encoding.GetCharsCommon(ptr + args.index, chars.Length, pChars, chars.Length);
428 }
429 }
430 });
431 }

References System.bytes, System.chars, System.count, System.index, System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowArgumentOutOfRangeException().