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

◆ ReadDataAsync()

async Task< int > System.Xml.XmlTextReaderImpl.ReadDataAsync ( )
inlineprivate

Definition at line 9401 of file XmlTextReaderImpl.cs.

9402 {
9403 if (_ps.isEof)
9404 {
9405 return 0;
9406 }
9407 int charsRead;
9408 if (_ps.appendMode)
9409 {
9410 if (_ps.charsUsed == _ps.chars.Length - 1)
9411 {
9412 for (int i = 0; i < _attrCount; i++)
9413 {
9415 }
9416 char[] array = new char[_ps.chars.Length * 2];
9417 BlockCopyChars(_ps.chars, 0, array, 0, _ps.chars.Length);
9418 _ps.chars = array;
9419 }
9420 if (_ps.stream != null && _ps.bytesUsed - _ps.bytePos < 6 && _ps.bytes.Length - _ps.bytesUsed < 6)
9421 {
9422 byte[] array2 = new byte[_ps.bytes.Length * 2];
9424 _ps.bytes = array2;
9425 }
9427 if (charsRead > 80)
9428 {
9429 charsRead = 80;
9430 }
9431 }
9432 else
9433 {
9434 int num = _ps.chars.Length;
9435 if (num - _ps.charsUsed <= num / 2)
9436 {
9437 for (int j = 0; j < _attrCount; j++)
9438 {
9440 }
9441 int num2 = _ps.charsUsed - _ps.charPos;
9442 if (num2 < num - 1)
9443 {
9445 if (num2 > 0)
9446 {
9448 }
9449 _ps.charPos = 0;
9451 }
9452 else
9453 {
9454 char[] array3 = new char[_ps.chars.Length * 2];
9455 BlockCopyChars(_ps.chars, 0, array3, 0, _ps.chars.Length);
9456 _ps.chars = array3;
9457 }
9458 }
9459 if (_ps.stream != null)
9460 {
9461 int num3 = _ps.bytesUsed - _ps.bytePos;
9462 if (num3 <= 128)
9463 {
9464 if (num3 == 0)
9465 {
9466 _ps.bytesUsed = 0;
9467 }
9468 else
9469 {
9472 }
9473 _ps.bytePos = 0;
9474 }
9475 }
9477 }
9478 if (_ps.stream != null)
9479 {
9480 if (!_ps.isStreamEof && _ps.bytePos == _ps.bytesUsed && _ps.bytes.Length - _ps.bytesUsed > 0)
9481 {
9483 if (num4 == 0)
9484 {
9485 _ps.isStreamEof = true;
9486 }
9488 }
9489 int bytePos = _ps.bytePos;
9491 if (charsRead == 0 && _ps.bytePos != bytePos)
9492 {
9493 return await ReadDataAsync().ConfigureAwait(continueOnCapturedContext: false);
9494 }
9495 }
9496 else if (_ps.textReader != null)
9497 {
9500 }
9501 else
9502 {
9503 charsRead = 0;
9504 }
9506 if (charsRead == 0)
9507 {
9508 _ps.isEof = true;
9509 }
9510 _ps.chars[_ps.charsUsed] = '\0';
9511 return charsRead;
9512 }
Task< int > ReadAsync(byte[] buffer, int offset, int count)
Definition Stream.cs:762
virtual Task< int > ReadAsync(char[] buffer, int index, int count)
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226
static void BlockCopy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int count)
int GetChars(int maxCharsCount)
void RegisterConsumedCharacters(long characters, bool inEntityReference)
static void BlockCopyChars(char[] src, int srcOffset, char[] dst, int dstOffset, int count)

References System.Xml.XmlTextReaderImpl._attrCount, System.Xml.XmlTextReaderImpl._index, System.Xml.XmlTextReaderImpl._nodes, System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl.ParsingState.appendMode, System.array, System.Xml.XmlTextReaderImpl.BlockCopy(), System.Xml.XmlTextReaderImpl.BlockCopyChars(), System.Xml.XmlTextReaderImpl.ParsingState.bytePos, System.Xml.XmlTextReaderImpl.ParsingState.bytes, System.Xml.XmlTextReaderImpl.ParsingState.bytesUsed, System.Xml.XmlTextReaderImpl.ParsingState.charPos, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Threading.Tasks.Task< TResult >.ConfigureAwait(), System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.GetChars(), System.Xml.XmlTextReaderImpl.ParsingState.isEof, System.Xml.XmlTextReaderImpl.ParsingState.isStreamEof, System.Xml.XmlTextReaderImpl.NodeData.OnBufferInvalidated(), System.IO.Stream.ReadAsync(), System.IO.TextReader.ReadAsync(), System.Xml.XmlTextReaderImpl.ReadDataAsync(), System.Xml.XmlTextReaderImpl.RegisterConsumedCharacters(), System.Xml.XmlTextReaderImpl.ParsingState.stream, and System.Xml.XmlTextReaderImpl.ParsingState.textReader.

Referenced by System.Xml.XmlTextReaderImpl.DtdParserProxy_ReadDataAsync(), System.Xml.XmlTextReaderImpl.EatWhitespacesAsync(), System.Xml.XmlTextReaderImpl.HandleEntityReferenceAsync(), System.Xml.XmlTextReaderImpl.InitStreamInputAsync(), System.Xml.XmlTextReaderImpl.InitTextReaderInputAsync(), System.Xml.XmlTextReaderImpl.ParseAttributesAsync(), System.Xml.XmlTextReaderImpl.ParseAttributeValueSlowAsync(), System.Xml.XmlTextReaderImpl.ParseCDataOrCommentTupleAsync(), System.Xml.XmlTextReaderImpl.ParseDoctypeDeclAsync(), System.Xml.XmlTextReaderImpl.ParseDocumentContentAsync_ReadData(), System.Xml.XmlTextReaderImpl.ParseElementAsync_ReadData(), System.Xml.XmlTextReaderImpl.ParseElementContent_ReadData(), System.Xml.XmlTextReaderImpl.ParseEndElementAsync_ReadData(), System.Xml.XmlTextReaderImpl.ParseEndElmentAsync_PrepareData(), System.Xml.XmlTextReaderImpl.ParseNamedCharRefAsync(), System.Xml.XmlTextReaderImpl.ParseNumericCharRefAsync(), System.Xml.XmlTextReaderImpl.ParsePIAsync(), System.Xml.XmlTextReaderImpl.ParsePIValueAsync(), System.Xml.XmlTextReaderImpl.ParseTextAsync_ReadData(), System.Xml.XmlTextReaderImpl.ParseXmlDeclarationAsync(), System.Xml.XmlTextReaderImpl.ReadDataAsync(), System.Xml.XmlTextReaderImpl.ReadDataInNameAsync(), System.Xml.XmlTextReaderImpl.SkipDtdAsync(), System.Xml.XmlTextReaderImpl.SkipUntilAsync(), System.Xml.XmlTextReaderImpl.SwitchEncodingAsync(), and System.Xml.XmlTextReaderImpl.ZeroEndingStreamAsync().