Stream.readAll()

DESCRIPTION

Read an exact amount of bytes from a stream.

This function blocks until the bytes is read.

DECLARATION

    public byte[] readAll(int length) throws NabtoEOFException

PARAMETERS

length:
The amount of bytes to read.

THROWS EXCEPTIONS

NabtoRuntimeException:
With error code STOPPED if the stream was stopped.
NabtoRuntimeException:
With error code OPERATION_IN_PROGRESS if another read is in progress.
NabtoEOFException:
if end of file is reached.

RETURNS

Bytes read, less than length bytes can be returned if