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

◆ CheckArray()

void System.Xml.XmlBinaryWriter.CheckArray ( Array array,
int offset,
int count )
inlineprivate

Definition at line 167 of file XmlBinaryWriter.cs.

168 {
169 if (array == null)
170 {
171 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("array"));
172 }
173 if (offset < 0)
174 {
175 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.ValueMustBeNonNegative));
176 }
177 if (offset > array.Length)
178 {
179 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.Format(System.SR.OffsetExceedsBufferSize, array.Length)));
180 }
181 if (count < 0)
182 {
183 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.ValueMustBeNonNegative));
184 }
185 if (count > array.Length - offset)
186 {
187 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, array.Length - offset)));
188 }
189 }
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, System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), and System.SR.ValueMustBeNonNegative.

Referenced by System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), System.Xml.XmlBinaryWriter.WriteArray(), and System.Xml.XmlBinaryWriter.WriteArray().