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

◆ CheckArray()

static void System.Runtime.Serialization.Json.XmlJsonReader.CheckArray ( Array array,
int offset,
int count )
inlinestaticpackage

Definition at line 596 of file XmlJsonReader.cs.

597 {
598 if (array == null)
599 {
600 throw new ArgumentNullException("array");
601 }
602 if (offset < 0)
603 {
604 throw new ArgumentOutOfRangeException("offset", System.SR.ValueMustBeNonNegative);
605 }
606 if (offset > array.Length)
607 {
608 throw new ArgumentOutOfRangeException("offset", System.SR.Format(System.SR.OffsetExceedsBufferSize, array.Length));
609 }
610 if (count < 0)
611 {
612 throw new ArgumentOutOfRangeException("count", System.SR.ValueMustBeNonNegative);
613 }
614 if (count > array.Length - offset)
615 {
616 throw new ArgumentOutOfRangeException("count", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
617 }
618 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string ValueMustBeNonNegative
Definition SR.cs:296
static string SizeExceedsRemainingBufferSpace
Definition SR.cs:324
static string OffsetExceedsBufferSize
Definition SR.cs:322
Definition SR.cs:7

References System.array, System.count, System.SR.Format(), System.offset, System.SR.OffsetExceedsBufferSize, System.SR.SizeExceedsRemainingBufferSpace, and System.SR.ValueMustBeNonNegative.

Referenced by System.Runtime.Serialization.Json.ByteArrayHelperWithString.ReadArray(), System.Runtime.Serialization.Json.JsonReaderDelegator.DateTimeArrayJsonHelperWithString.ReadArray(), and System.Runtime.Serialization.Json.ByteArrayHelperWithString.WriteArray().