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

◆ Encode()

void System.Xml.Base64Encoder.Encode ( byte[] buffer,
int index,
int count )
inlinepackageinherited

Definition at line 20 of file Base64Encoder.cs.

21 {
22 if (buffer == null)
23 {
24 throw new ArgumentNullException("buffer");
25 }
26 if (index < 0)
27 {
28 throw new ArgumentOutOfRangeException("index");
29 }
30 if (count < 0)
31 {
32 throw new ArgumentOutOfRangeException("count");
33 }
34 if (count > buffer.Length - index)
35 {
36 throw new ArgumentOutOfRangeException("count");
37 }
38 if (_leftOverBytesCount > 0)
39 {
42 {
44 count--;
45 }
46 if (count == 0 && leftOverBytesCount < 3)
47 {
49 return;
50 }
51 int count2 = Convert.ToBase64CharArray(_leftOverBytes, 0, 3, _charsLine, 0);
53 }
55 if (_leftOverBytesCount > 0)
56 {
58 if (_leftOverBytes == null)
59 {
60 _leftOverBytes = new byte[3];
61 }
62 for (int i = 0; i < _leftOverBytesCount; i++)
63 {
65 }
66 }
67 int num = index + count;
68 int num2 = 768;
69 while (index < num)
70 {
71 if (index + num2 > num)
72 {
73 num2 = num - index;
74 }
75 int count3 = Convert.ToBase64CharArray(buffer, index, num2, _charsLine, 0);
77 index += num2;
78 }
79 }
readonly char[] _charsLine
void WriteChars(char[] chars, int index, int count)

References System.Xml.Base64Encoder._charsLine, System.Xml.Base64Encoder._leftOverBytes, System.Xml.Base64Encoder._leftOverBytesCount, System.buffer, System.count, System.Xml.Dictionary, System.index, System.Convert.ToBase64CharArray(), and System.Xml.Base64Encoder.WriteChars().

Referenced by System.Xml.XmlRawWriter.WriteBase64().