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

◆ InternalRead()

ReadOnlySpan< byte > System.IO.BinaryReader.InternalRead ( int numBytes)
inlineprivateinherited

Definition at line 470 of file BinaryReader.cs.

471 {
472 if (_isMemoryStream)
473 {
474 return ((MemoryStream)_stream).InternalReadSpan(numBytes);
475 }
477 int num = 0;
478 do
479 {
480 int num2 = _stream.Read(_buffer, num, numBytes - num);
481 if (num2 == 0)
482 {
483 ThrowHelper.ThrowEndOfFileException();
484 }
485 num += num2;
486 }
487 while (num < numBytes);
488 return _buffer;
489 }
readonly Stream _stream
readonly bool _isMemoryStream
readonly byte[] _buffer
int Read(byte[] buffer, int offset, int count)

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

Referenced by System.IO.BinaryReader.ReadDecimal(), System.IO.BinaryReader.ReadDouble(), System.IO.BinaryReader.ReadHalf(), System.IO.BinaryReader.ReadInt16(), System.IO.BinaryReader.ReadInt32(), System.IO.BinaryReader.ReadInt64(), System.IO.BinaryReader.ReadSingle(), System.IO.BinaryReader.ReadUInt16(), System.IO.BinaryReader.ReadUInt32(), and System.IO.BinaryReader.ReadUInt64().