Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

BinaryReader.Read Method (Byte[], Int32, Int32)

Reads count bytes from the stream with index as the starting point in the byte array.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

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

Parameters

buffer
Type: System.Byte[]
The buffer to read data into.
index
Type: System.Int32
The starting point in the buffer at which to begin reading into the buffer.
count
Type: System.Int32
The number of characters to read.

Return Value

Type: System.Int32
The number of characters 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.

ExceptionCondition
ArgumentException

The buffer length minus index is less than count.

ArgumentNullException

buffer is null.

ArgumentOutOfRangeException

index or count is negative.

ObjectDisposedException

The stream is closed.

IOException

An I/O error occurs.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

Show:
© 2014 Microsoft