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

◆ GetChars() [1/3]

static long System.Text.EncodingExtensions.GetChars ( this Encoding encoding,
in ReadOnlySequence< byte > bytes,
IBufferWriter< char > writer )
inlinestatic

Definition at line 142 of file EncodingExtensions.cs.

143 {
144 if (encoding == null)
145 {
146 throw new ArgumentNullException("encoding");
147 }
148 if (writer == null)
149 {
150 throw new ArgumentNullException("writer");
151 }
152 if (bytes.IsSingleSegment)
153 {
154 return encoding.GetChars(bytes.FirstSpan, writer);
155 }
156 encoding.GetDecoder().Convert(in bytes, writer, flush: true, out var charsUsed, out var _);
157 return charsUsed;
158 }

References System.bytes, System.Text.Encoding.GetChars(), System.Text.Encoding.GetDecoder(), and System.writer.