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

◆ SetInput() [1/4]

void System.Xml.XmlUTF8TextReader.SetInput ( byte[] buffer,
int offset,
int count,
Encoding encoding,
XmlDictionaryReaderQuotas quotas,
OnXmlDictionaryReaderClose onClose )
inline

Definition at line 96 of file XmlUTF8TextReader.cs.

97 {
98 if (buffer == null)
99 {
100 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("buffer"));
101 }
102 if (offset < 0)
103 {
104 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.ValueMustBeNonNegative));
105 }
106 if (offset > buffer.Length)
107 {
108 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.Format(System.SR.OffsetExceedsBufferSize, buffer.Length)));
109 }
110 if (count < 0)
111 {
112 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.ValueMustBeNonNegative));
113 }
114 if (count > buffer.Length - offset)
115 {
116 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
117 }
119 ArraySegment<byte> arraySegment = EncodingStreamWrapper.ProcessBuffer(buffer, offset, count, encoding);
120 base.BufferReader.SetBuffer(arraySegment.Array, arraySegment.Offset, arraySegment.Count, null, null);
121 _buffered = true;
122 }
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
void MoveToInitial(XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)

References System.Xml.XmlUTF8TextReader._buffered, System.buffer, System.count, System.Xml.Dictionary, System.SR.Format(), System.Xml.XmlUTF8TextReader.MoveToInitial(), System.offset, System.SR.OffsetExceedsBufferSize, System.Xml.EncodingStreamWrapper.ProcessBuffer(), System.SR.SizeExceedsRemainingBufferSpace, System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), and System.SR.ValueMustBeNonNegative.