Click or drag to resize
BinaryReader Class
Reads primitive data types as binary values in a specific encoding.
Inheritance Hierarchy
SystemObject
  System.IOBinaryReader

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public class BinaryReader : IDisposable

The BinaryReader type exposes the following members.

Methods
  NameDescription
Public methodClose
Closes the current reader and the underlying stream.
Public methodDispose
Releases all resources used by the current instance of the BinaryReader class.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by the BinaryReader class and optionally releases the managed resources.
Public methodEquals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPeekChar
Returns the next available character and does not advance the byte or character position.
Public methodRead
Reads characters from the underlying stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream.
Public methodRead(Byte, Int32, Int32)
Reads the specified number of bytes from the stream, starting from a specified point in the byte array.
Public methodRead(Char, Int32, Int32)
Reads the specified number of characters from the stream, starting from a specified point in the character array.
Protected methodRead7BitEncodedInt
Reads in a 32-bit integer in compressed format.
Public methodReadBoolean
Reads a Boolean value from the current stream and advances the current position of the stream by one byte.
Public methodReadByte
Reads the next byte from the current stream and advances the current position of the stream by one byte.
Public methodReadBytes
Reads the specified number of bytes from the current stream into a byte array and advances the current position by that number of bytes.
Public methodReadChar
Reads the next character from the current stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream.
Public methodReadChars
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 Encoding used and the specific character being read from the stream.
Public methodReadDouble
Reads an 8-byte floating point value from the current stream and advances the current position of the stream by eight bytes.
Public methodReadInt16
Reads a 2-byte signed integer from the current stream and advances the current position of the stream by two bytes.
Public methodReadInt32
Reads a 4-byte signed integer from the current stream and advances the current position of the stream by four bytes.
Public methodReadInt64
Reads an 8-byte signed integer from the current stream and advances the current position of the stream by eight bytes.
Public methodReadSByte
Reads a signed byte from this stream and advances the current position of the stream by one byte.
Public methodReadSingle
Reads a 4-byte floating point value from the current stream and advances the current position of the stream by four bytes.
Public methodReadString
Reads a string from the current stream. The string is prefixed with the length, encoded as an integer seven bits at a time.
Public methodReadUInt16
Reads a 2-byte unsigned integer from the current stream using little-endian encoding and advances the position of the stream by two bytes.
Public methodReadUInt32
Reads a 4-byte unsigned integer from the current stream and advances the position of the stream by four bytes.
Public methodReadUInt64
Reads an 8-byte unsigned integer from the current stream and advances the position of the stream by eight bytes.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyBaseStream
Exposes access to the underlying stream of the BinaryReader.
Top
See Also