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

◆ FinalFlushWriteBuffers()

ArraySegment< byte > System.Text.TranscodingStream.FinalFlushWriteBuffers ( )
inlineprivate

Definition at line 179 of file TranscodingStream.cs.

180 {
181 if (_thisDecoder == null || _innerEncoder == null)
182 {
183 return default(ArraySegment<byte>);
184 }
185 char[] chars = Array.Empty<char>();
186 int num = _thisDecoder.GetCharCount(Array.Empty<byte>(), 0, 0, flush: true);
187 if (num > 0)
188 {
189 chars = new char[num];
190 num = _thisDecoder.GetChars(Array.Empty<byte>(), 0, 0, chars, 0, flush: true);
191 }
192 byte[] array = Array.Empty<byte>();
193 int num2 = _innerEncoder.GetByteCount(chars, 0, num, flush: true);
194 if (num2 > 0)
195 {
196 array = new byte[num2];
197 num2 = _innerEncoder.GetBytes(chars, 0, num, array, 0, flush: true);
198 }
199 return new ArraySegment<byte>(array, 0, num2);
200 }
int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
int GetCharCount(byte[] bytes, int index, int count)
int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, bool flush)
int GetByteCount(char[] chars, int index, int count, bool flush)

References System.Text.TranscodingStream._innerEncoder, System.Text.TranscodingStream._thisDecoder, System.array, System.chars, System.Text.Encoder.GetByteCount(), System.Text.Encoder.GetBytes(), System.Text.Decoder.GetCharCount(), and System.Text.Decoder.GetChars().

Referenced by System.Text.TranscodingStream.Dispose(), and System.Text.TranscodingStream.DisposeAsync().