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

◆ GetString() [3/4]

unsafe override string System.Text.ASCIIEncoding.GetString ( byte[] bytes,
int byteIndex,
int byteCount )
inlinevirtualinherited

Reimplemented from System.Text.Encoding.

Definition at line 417 of file ASCIIEncoding.cs.

418 {
419 if (bytes == null)
420 {
421 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.bytes, ExceptionResource.ArgumentNull_Array);
422 }
423 if ((byteIndex | byteCount) < 0)
424 {
425 ThrowHelper.ThrowArgumentOutOfRangeException((byteIndex < 0) ? ExceptionArgument.byteIndex : ExceptionArgument.byteCount, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum);
426 }
427 if (bytes.Length - byteIndex < byteCount)
428 {
429 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.bytes, ExceptionResource.ArgumentOutOfRange_IndexCountBuffer);
430 }
431 if (byteCount == 0)
432 {
433 return string.Empty;
434 }
435 fixed (byte* ptr = bytes)
436 {
437 return string.CreateStringFromEncoding(ptr + byteIndex, byteCount, this);
438 }
439 }

References System.byteCount, System.byteIndex, System.bytes, System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowArgumentOutOfRangeException().