Stream.readAll()

DESCRIPTION

Read exactly the specified amount of bytes. Blocks until all bytes read.

If all bytes could not be read (EOF or an error occurs or stream is aborted), an error is thrown.

DECLARATION

    public func readAll(length: Int) throws -> Data 

PARAMETERS

length:
The number of bytes to read

ERRORS

Throws the following errors:

EOF:
if end of file is reached
ABORTED:
if the stream is aborted
OPERATION_IN_PROGRESS:
if another read is in progress

RETURN VALUES

the data read

EXAMPLES

None.