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

◆ WriteBase64()

override void System.Xml.XmlBaseWriter.WriteBase64 ( byte[] buffer,
int offset,
int count )
inlineinherited

Definition at line 2304 of file XmlBaseWriter.cs.

2305 {
2306 if (IsClosed)
2307 {
2308 ThrowClosed();
2309 }
2310 if (buffer == null)
2311 {
2312 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("buffer"));
2313 }
2314 if (offset < 0)
2315 {
2316 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.ValueMustBeNonNegative));
2317 }
2318 if (count < 0)
2319 {
2320 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.ValueMustBeNonNegative));
2321 }
2322 if (count > buffer.Length - offset)
2323 {
2324 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
2325 }
2326 if (count <= 0)
2327 {
2328 return;
2329 }
2330 if (_trailByteCount > 0)
2331 {
2333 {
2335 count--;
2336 }
2337 }
2338 int num = _trailByteCount + count;
2339 int num2 = num - num % 3;
2340 if (_trailBytes == null)
2341 {
2342 _trailBytes = new byte[3];
2343 }
2344 if (num2 >= 3)
2345 {
2346 if (_attributeValue != null)
2347 {
2348 WriteAttributeText(XmlConverter.Base64Encoding.GetString(_trailBytes, 0, _trailByteCount));
2349 WriteAttributeText(XmlConverter.Base64Encoding.GetString(buffer, offset, num2 - _trailByteCount));
2350 }
2351 if (!_isXmlnsAttribute)
2352 {
2353 StartContent();
2355 EndContent();
2356 }
2357 _trailByteCount = num - num2;
2358 if (_trailByteCount > 0)
2359 {
2360 int num3 = offset + count - _trailByteCount;
2361 for (int i = 0; i < _trailByteCount; i++)
2362 {
2363 _trailBytes[i] = buffer[num3++];
2364 }
2365 }
2366 }
2367 else
2368 {
2371 }
2372 }
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
Definition SR.cs:7
void WriteAttributeText(string value)
void WriteBase64Text(byte[] trailBuffer, int trailCount, byte[] buffer, int offset, int count)

References System.Xml.XmlBaseWriter._attributeValue, System.Xml.XmlBaseWriter._isXmlnsAttribute, System.Xml.XmlBaseWriter._trailByteCount, System.Xml.XmlBaseWriter._trailBytes, System.Xml.XmlBaseWriter._writer, System.Xml.XmlConverter.Base64Encoding, System.Buffer.BlockCopy(), System.buffer, System.count, System.Xml.Dictionary, System.Xml.XmlBaseWriter.EndContent(), System.SR.Format(), System.Xml.XmlBaseWriter.IsClosed, System.offset, System.SR.SizeExceedsRemainingBufferSpace, System.Xml.XmlBaseWriter.StartContent(), System.Xml.XmlBaseWriter.ThrowClosed(), System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.SR.ValueMustBeNonNegative, System.Xml.XmlBaseWriter.WriteAttributeText(), and System.Xml.XmlNodeWriter.WriteBase64Text().

Referenced by System.Xml.XmlBinaryWriter.WriteTextNode().