System.IO.BinaryReader.Read Method

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

Syntax

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

Parameters

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 buffer. 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.

Remarks

System.IO.BinaryReader does not restore the file position after an unsuccessful read operation.

For a list of common I/O tasks, see Common I/O Tasks.

Requirements

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