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

◆ ReadValueChunk()

override int System.Xml.XmlBaseReader.ReadValueChunk ( char[] chars,
int offset,
int count )
inlinevirtualinherited

Reimplemented from System.Xml.XmlReader.

Definition at line 2224 of file XmlBaseReader.cs.

2225 {
2226 if (chars == null)
2227 {
2228 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("chars"));
2229 }
2230 if (offset < 0)
2231 {
2232 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.ValueMustBeNonNegative));
2233 }
2234 if (offset > chars.Length)
2235 {
2236 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.Format(System.SR.OffsetExceedsBufferSize, chars.Length)));
2237 }
2238 if (count < 0)
2239 {
2240 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.ValueMustBeNonNegative));
2241 }
2242 if (count > chars.Length - offset)
2243 {
2244 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)));
2245 }
2246 if (_value == null && _node.QNameType == QNameType.Normal && _node.Value.TryReadChars(chars, offset, count, out var actual))
2247 {
2248 return actual;
2249 }
2250 string value = Value;
2251 actual = Math.Min(count, value.Length);
2252 value.CopyTo(0, chars, offset, actual);
2253 _value = value.Substring(actual);
2254 return actual;
2255 }
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
bool TryReadChars(char[] chars, int offset, int count, out int actual)

References System.Xml.XmlBaseReader._node, System.Xml.XmlBaseReader._value, System.chars, System.count, System.Xml.Dictionary, System.SR.Format(), System.Math.Min(), System.offset, System.SR.OffsetExceedsBufferSize, System.Xml.XmlBaseReader.XmlNode.QNameType, System.SR.SizeExceedsRemainingBufferSpace, System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.Xml.ValueHandle.TryReadChars(), System.value, System.Xml.XmlBaseReader.XmlNode.Value, System.Xml.XmlBaseReader.Value, and System.SR.ValueMustBeNonNegative.

Referenced by System.Xml.XmlBaseReader.ReadBytes().