Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ ReadValueChunk()

override int System.Runtime.Serialization.Json.XmlJsonReader.ReadValueChunk ( char[] chars,
int offset,
int count )
inlinevirtual

Reimplemented from System.Xml.XmlReader.

Definition at line 506 of file XmlJsonReader.cs.

507 {
509 {
510 if (chars == null)
511 {
512 throw new ArgumentNullException("chars");
513 }
514 if (offset < 0)
515 {
516 throw new ArgumentOutOfRangeException("offset", System.SR.ValueMustBeNonNegative);
517 }
518 if (offset > chars.Length)
519 {
520 throw new ArgumentOutOfRangeException("offset", System.SR.Format(System.SR.OffsetExceedsBufferSize, chars.Length));
521 }
522 if (count < 0)
523 {
524 throw new ArgumentOutOfRangeException("count", System.SR.ValueMustBeNonNegative);
525 }
526 if (count > chars.Length - offset)
527 {
528 throw new ArgumentOutOfRangeException("count", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, chars.Length - offset));
529 }
530 string text = UnescapeJsonString(base.Node.ValueAsString);
531 int num = Math.Min(count, text.Length);
532 if (num > 0)
533 {
534 text.CopyTo(0, chars, offset, num);
535 if (base.Node.QNameType == QNameType.Xmlns)
536 {
537 base.Node.Namespace.Uri.SetValue(0, 0);
538 }
539 else
540 {
541 base.Node.Value.SetValue(ValueHandleType.UTF8, 0, 0);
542 }
543 }
544 return num;
545 }
546 return base.ReadValueChunk(chars, offset, count);
547 }
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.chars, System.count, System.Runtime.Serialization.Dictionary, System.SR.Format(), System.Runtime.Serialization.Json.XmlJsonReader.IsAttributeValue, System.Math.Min(), System.offset, System.SR.OffsetExceedsBufferSize, System.SR.SizeExceedsRemainingBufferSpace, System.text, System.Runtime.Serialization.Json.XmlJsonReader.UnescapeJsonString(), and System.SR.ValueMustBeNonNegative.