class BinaryReader

in global :: System . IO

Reads primitive data types as binary values in a specific encoding.


public BinaryReader( Stream input )

Initializes a new instance of the class based on the specified stream and using UTF-8 encoding.

  • input The input stream.

public BinaryReader( Stream input, Encoding encoding )

Initializes a new instance of the class based on the specified stream and character encoding.

  • input The input stream.
  • encoding The character encoding to use.

public BinaryReader( Stream input, Encoding encoding, bool leaveOpen )

Initializes a new instance of the class based on the specified stream and character encoding, and optionally leaves the stream open.

  • input The input stream.
  • encoding The character encoding to use.
  • leaveOpen to leave the stream open after the object is disposed; otherwise, .

public Stream BaseStream { get; }

Exposes access to the underlying stream of the .

  • Returns The underlying stream associated with the .

public int Read( byte[] buffer, int index, int count )

Reads the specified number of bytes from the stream, starting from a specified point in the byte array.

  • buffer The buffer to read data into.
  • index The starting point in the buffer at which to begin reading into the buffer.
  • count The number of bytes to read.
  • Returns The number of bytes read into . This might be less than the number of bytes requested if that many bytes are not available, or it might be zero if the end of the stream is reached.

public int Read( char[] buffer, int index, int count )

Reads the specified number of characters from the stream, starting from a specified point in the character array.

  • buffer The buffer to read data into.
  • index The starting point in the buffer at which to begin reading into the buffer.
  • count The number of characters to read.
  • Returns The total number of characters read into the buffer. This might be less than the number of characters requested if that many characters are not currently available, or it might be zero if the end of the stream is reached.

public byte[] ReadBytes( int count )

Reads the specified number of bytes from the current stream into a byte array and advances the current position by that number of bytes.

  • count The number of bytes to read. This value must be 0 or a non-negative number or an exception will occur.
  • Returns A byte array containing data read from the underlying stream. This might be less than the number of bytes requested if the end of the stream is reached.

public char[] ReadChars( int count )

Reads the specified number of characters from the current stream, returns the data in a character array, and advances the current position in accordance with the used and the specific character being read from the stream.

  • count The number of characters to read.
  • Returns A character array containing data read from the underlying stream. This might be less than the number of characters requested if the end of the stream is reached.

public double ReadDouble( )

😔 No documentation found.

public void Dispose( )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public long Read7BitEncodedInt64( )

😔 No documentation found.

public int Read7BitEncodedInt( )

😔 No documentation found.

public int Read( Span<byte> buffer )

😔 No documentation found.

public int Read( Span<char> buffer )

😔 No documentation found.

public int PeekChar( )

😔 No documentation found.

public string ReadString( )

😔 No documentation found.

public void Close( )

😔 No documentation found.

public float ReadSingle( )

😔 No documentation found.

public Half ReadHalf( )

😔 No documentation found.

public ulong ReadUInt64( )

😔 No documentation found.

public long ReadInt64( )

😔 No documentation found.

public uint ReadUInt32( )

😔 No documentation found.

public int ReadInt32( )

😔 No documentation found.

public ushort ReadUInt16( )

😔 No documentation found.

public short ReadInt16( )

😔 No documentation found.

public char ReadChar( )

😔 No documentation found.

public bool ReadBoolean( )

😔 No documentation found.

public sbyte ReadSByte( )

😔 No documentation found.

public byte ReadByte( )

😔 No documentation found.

public decimal ReadDecimal( )

😔 No documentation found.

public int Read( )

😔 No documentation found.