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 stopped), an error is thrown.

DECLARATION

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

PARAMETERS

length:
The number of bytes to read

THROWS ERRORS

EOF:
if end of file is reached
STOPPED:
if the stream is stopped
OPERATION_IN_PROGRESS:
if another read is in progress

RETURNS

the data read