IByteStream.read

Overview | Methods | This Package | All Packages

IByteStream.read

Reads a specified number of bytes from this stream into an array starting at a specified position.

Syntax

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

Parameters

buffer

The byte array to read data into.

index

The starting index in the buffer.

count

The number of bytes to read.

Return Value

Returns the total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes aren't currently available, or it can be zero if the end of the stream is reached.

Exceptions

IOException thrown if an I/O error occurs or if the stream does not support reading.

Remarks

Retrieves the actual number of bytes read. If the read operation is successful, the current position of the stream is advanced by the number of bytes read.

See Also   write