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

◆ TryReadBase64()

bool System.Xml.ValueHandle.TryReadBase64 ( byte[] buffer,
int offset,
int count,
out int actual )
inline

Definition at line 630 of file ValueHandle.cs.

631 {
632 if (_type == ValueHandleType.Base64)
633 {
634 actual = Math.Min(_length, count);
636 _offset += actual;
637 _length -= actual;
638 return true;
639 }
640 if (_type == ValueHandleType.UTF8 && count >= 3 && _length % 4 == 0)
641 {
642 try
643 {
644 int num = Math.Min(count / 3 * 4, _length);
646 _offset += num;
647 _length -= num;
648 return true;
649 }
650 catch (FormatException)
651 {
652 }
653 }
654 actual = 0;
655 return false;
656 }
unsafe override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex)
ValueHandleType _type
void GetBase64(byte[] buffer, int offset, int count)
readonly XmlBufferReader _bufferReader
Definition ValueHandle.cs:9

References System.Xml.ValueHandle._bufferReader, System.Xml.ValueHandle._length, System.Xml.ValueHandle._offset, System.Xml.ValueHandle._type, System.buffer, System.Xml.XmlBufferReader.Buffer, System.count, System.Xml.Dictionary, System.Xml.ValueHandle.GetBase64(), System.Text.Base64Encoding.GetBytes(), System.Math.Min(), and System.offset.

Referenced by System.Xml.XmlBaseReader.ReadContentAsBase64(), and System.Xml.XmlBaseReader.ReadValueAsBase64().