read

Reads a chunk of data from the stream.

Reads and returns the specified number of bytes, or fewer if the end of stream is reached. Throws a StreamNotOpenException if the stream is not open for reading.

Syntax

public byte[] read(long length)

Parameters

Returns

read returns a chunk of binary data read from the stream, or a null value if the end of the stream has been reached.

Examples