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

◆ ReadBuffer() [1/2]

virtual int System.IO.StreamReader.ReadBuffer ( )
inlinepackagevirtual

Reimplemented in System.IO.StreamReader.NullStreamReader.

Definition at line 534 of file StreamReader.cs.

535 {
536 _charLen = 0;
537 _charPos = 0;
538 if (!_checkPreamble)
539 {
540 _byteLen = 0;
541 }
542 do
543 {
544 if (_checkPreamble)
545 {
546 int num = _stream.Read(_byteBuffer, _bytePos, _byteBuffer.Length - _bytePos);
547 if (num == 0)
548 {
549 if (_byteLen > 0)
550 {
552 _bytePos = (_byteLen = 0);
553 }
554 return _charLen;
555 }
556 _byteLen += num;
557 }
558 else
559 {
561 if (_byteLen == 0)
562 {
563 return _charLen;
564 }
565 }
567 if (!IsPreamble())
568 {
569 if (_detectEncoding && _byteLen >= 2)
570 {
572 }
574 }
575 }
576 while (_charLen == 0);
577 return _charLen;
578 }
readonly Stream _stream
readonly byte[] _byteBuffer
int Read(byte[] buffer, int offset, int count)
int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)

References System.IO.StreamReader._byteBuffer, System.IO.StreamReader._byteLen, System.IO.StreamReader._bytePos, System.IO.StreamReader._charBuffer, System.IO.StreamReader._charLen, System.IO.StreamReader._charPos, System.IO.StreamReader._checkPreamble, System.IO.StreamReader._decoder, System.IO.StreamReader._detectEncoding, System.IO.StreamReader._isBlocked, System.IO.StreamReader._stream, System.IO.StreamReader.DetectEncoding(), System.Text.Decoder.GetChars(), System.IO.StreamReader.IsPreamble(), and System.IO.Stream.Read().

Referenced by System.IO.StreamReader.Peek(), System.IO.StreamReader.Read(), System.IO.StreamReader.ReadLine(), System.IO.StreamReader.ReadSpan(), and System.IO.StreamReader.ReadToEnd().