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

◆ TryDrainRemainingDataForGetChars()

bool System.Text.DecoderFallbackBuffer.TryDrainRemainingDataForGetChars ( Span< char > chars,
out int charsWritten )
inlinepackageinherited

Definition at line 185 of file DecoderFallbackBuffer.cs.

186 {
187 int length = chars.Length;
188 while (true)
189 {
190 Rune nextRune;
191 Rune rune = (nextRune = GetNextRune());
192 if (rune.Value == 0)
193 {
194 break;
195 }
196 if (nextRune.TryEncodeToUtf16(chars, out var charsWritten2))
197 {
198 chars = chars.Slice(charsWritten2);
199 continue;
200 }
202 charsWritten = 0;
203 return false;
204 }
205 charsWritten = length - chars.Length;
206 return true;
207 }

References System.chars, System.Text.DecoderFallbackBuffer.GetNextRune(), System.Text.DecoderFallbackBuffer.InternalReset(), System.length, System.Text.Rune.TryEncodeToUtf16(), and System.Text.Rune.Value.

Referenced by System.Text.DecoderNLS.DrainLeftoverDataForGetChars(), and System.Text.DecoderFallbackBuffer.TryInternalFallbackGetChars().