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

◆ ReadValueAsBase64()

override int System.Xml.XmlBaseReader.ReadValueAsBase64 ( byte[] buffer,
int offset,
int count )
inlinevirtualinherited

Reimplemented from System.Xml.XmlDictionaryReader.

Definition at line 2257 of file XmlBaseReader.cs.

2258 {
2259 if (buffer == null)
2260 {
2261 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("buffer"));
2262 }
2263 if (offset < 0)
2264 {
2265 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.ValueMustBeNonNegative));
2266 }
2267 if (offset > buffer.Length)
2268 {
2269 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.Format(System.SR.OffsetExceedsBufferSize, buffer.Length)));
2270 }
2271 if (count < 0)
2272 {
2273 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.ValueMustBeNonNegative));
2274 }
2275 if (count > buffer.Length - offset)
2276 {
2277 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
2278 }
2279 if (count == 0)
2280 {
2281 return 0;
2282 }
2283 if (_value == null && _trailByteCount == 0 && _trailCharCount == 0 && _node.QNameType == QNameType.Normal && _node.Value.TryReadBase64(buffer, offset, count, out var actual))
2284 {
2285 return actual;
2286 }
2287 return ReadBytes(Base64Encoding, 3, 4, buffer, offset, Math.Min(count, 512), readContent: false);
2288 }
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 TryReadBase64(byte[] buffer, int offset, int count, out int actual)
int ReadBytes(Encoding encoding, int byteBlock, int charBlock, byte[] buffer, int offset, int byteCount, bool readContent)

References System.Xml.XmlBaseReader._node, System.Xml.XmlBaseReader._trailByteCount, System.Xml.XmlBaseReader._trailCharCount, System.Xml.XmlBaseReader._value, System.buffer, System.count, System.Xml.Dictionary, System.SR.Format(), System.Math.Min(), System.offset, System.SR.OffsetExceedsBufferSize, System.Xml.XmlBaseReader.XmlNode.QNameType, System.Xml.XmlBaseReader.ReadBytes(), System.SR.SizeExceedsRemainingBufferSpace, System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.Xml.ValueHandle.TryReadBase64(), System.Xml.XmlBaseReader.XmlNode.Value, and System.SR.ValueMustBeNonNegative.