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

◆ EncodeAsync()

async Task System.Xml.Base64Encoder.EncodeAsync ( byte[] buffer,
int index,
int count )
inlinepackageinherited

Definition at line 93 of file Base64Encoder.cs.

94 {
95 if (buffer == null)
96 {
97 throw new ArgumentNullException("buffer");
98 }
99 if (index < 0)
100 {
101 throw new ArgumentOutOfRangeException("index");
102 }
103 if (count < 0)
104 {
105 throw new ArgumentOutOfRangeException("count");
106 }
107 if (count > buffer.Length - index)
108 {
109 throw new ArgumentOutOfRangeException("count");
110 }
111 if (_leftOverBytesCount > 0)
112 {
115 {
117 count--;
118 }
119 if (count == 0 && leftOverBytesCount < 3)
120 {
122 return;
123 }
124 int count2 = Convert.ToBase64CharArray(_leftOverBytes, 0, 3, _charsLine, 0);
126 }
128 if (_leftOverBytesCount > 0)
129 {
131 if (_leftOverBytes == null)
132 {
133 _leftOverBytes = new byte[3];
134 }
135 for (int i = 0; i < _leftOverBytesCount; i++)
136 {
138 }
139 }
140 int endIndex = index + count;
141 int chunkSize = 768;
142 while (index < endIndex)
143 {
144 if (index + chunkSize > endIndex)
145 {
147 }
148 int count3 = Convert.ToBase64CharArray(buffer, index, chunkSize, _charsLine, 0);
150 index += chunkSize;
151 }
152 }
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226
readonly char[] _charsLine
Task WriteCharsAsync(char[] chars, int index, int count)

References System.Xml.Base64Encoder._charsLine, System.Xml.Base64Encoder._leftOverBytes, System.Xml.Base64Encoder._leftOverBytesCount, System.buffer, System.Threading.Tasks.Task< TResult >.ConfigureAwait(), System.count, System.Xml.Dictionary, System.endIndex, System.index, System.Convert.ToBase64CharArray(), and System.Xml.Base64Encoder.WriteCharsAsync().

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