Stream.readSomeAsync() Overload 1

DESCRIPTION

Read some bytes from a stream asynchronously.

Closure is invoked when at least 1 byte is read or the stream is closed or end of file is reached.

DECLARATION

    public func readSomeAsync(closure: @escaping AsyncDataReceiver) 

PARAMETERS

closure:
Invoked when the operation completes, see synchronous readSome() for possible errors.

Overload 2

DESCRIPTION

Read some bytes from a stream asynchronously. By using await the task will wait until 1 byte is read or the stream is closed or EOF is reached.

DECLARATION

    public func readSomeAsync() async throws -> Data 

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