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

◆ GetChars()

int System.Xml.XmlTextReaderImpl.GetChars ( int maxCharsCount)
inlineprivate

Definition at line 3565 of file XmlTextReaderImpl.cs.

3566 {
3567 int bytesUsed = _ps.bytesUsed - _ps.bytePos;
3568 if (bytesUsed == 0)
3569 {
3570 return 0;
3571 }
3572 int charsUsed;
3573 try
3574 {
3575 _ps.decoder.Convert(_ps.bytes, _ps.bytePos, bytesUsed, _ps.chars, _ps.charsUsed, maxCharsCount, flush: false, out bytesUsed, out charsUsed, out var _);
3576 }
3577 catch (ArgumentException)
3578 {
3579 InvalidCharRecovery(ref bytesUsed, out charsUsed);
3580 }
3581 _ps.bytePos += bytesUsed;
3582 _ps.charsUsed += charsUsed;
3583 return charsUsed;
3584 }
virtual void Convert(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed)
Definition Decoder.cs:142
void InvalidCharRecovery(ref int bytesCount, out int charsCount)

References System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl.ParsingState.bytePos, System.Xml.XmlTextReaderImpl.ParsingState.bytes, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Text.Decoder.Convert(), System.Xml.XmlTextReaderImpl.ParsingState.decoder, System.Xml.Dictionary, and System.Xml.XmlTextReaderImpl.InvalidCharRecovery().

Referenced by System.Xml.XmlTextReaderImpl.ReadData(), and System.Xml.XmlTextReaderImpl.ReadDataAsync().