System.IO.BinaryReader Class

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

See Also: BinaryReader Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public class BinaryReader : IDisposable

Remarks

The System.IO.BinaryReader class provides methods that simplify reading primitive data types from a stream. For example, you can use the BinaryReader.ReadBoolean method to read the next byte as a Boolean value and advance the current position in the stream by one byte. The class includes read methods that support different data types.

When you create a new instance of the System.IO.BinaryReader class, you provide the stream to read from, and optionally specify the type of encoding and whether to leave the stream open after disposing the System.IO.BinaryReader object. If you do not specify an encoding type, UTF-8 is used.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0