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

◆ FillBuffer()

virtual void System.IO.BinaryReader.FillBuffer ( int numBytes)
inlineprotectedvirtualinherited

Definition at line 491 of file BinaryReader.cs.

492 {
493 if (numBytes < 0 || numBytes > _buffer.Length)
494 {
495 throw new ArgumentOutOfRangeException("numBytes", SR.ArgumentOutOfRange_BinaryReaderFillBuffer);
496 }
497 int num = 0;
498 int num2 = 0;
500 if (numBytes == 1)
501 {
502 num2 = _stream.ReadByte();
503 if (num2 == -1)
504 {
505 ThrowHelper.ThrowEndOfFileException();
506 }
507 _buffer[0] = (byte)num2;
508 return;
509 }
510 do
511 {
512 num2 = _stream.Read(_buffer, num, numBytes - num);
513 if (num2 == 0)
514 {
515 ThrowHelper.ThrowEndOfFileException();
516 }
517 num += num2;
518 }
519 while (num < numBytes);
520 }
readonly Stream _stream
readonly byte[] _buffer
virtual int ReadByte()
Definition Stream.cs:994
int Read(byte[] buffer, int offset, int count)

References System.IO.BinaryReader._buffer, System.IO.BinaryReader._stream, System.SR.ArgumentOutOfRange_BinaryReaderFillBuffer, System.IO.Stream.Read(), System.IO.Stream.ReadByte(), System.ThrowHelper.ThrowEndOfFileException(), and System.IO.BinaryReader.ThrowIfDisposed().