Read exactly n bytes from a stream.
If (readLength != bufferLength), the stream has reached a state where the amount of bytes specified by bufferLength could NOT be read. The amount of bytes which could be read is copied to the buffer and readLength is less than bufferLength In any subsequent invocation, NABTO_CLIENT_EC_EOF will be returned.
NABTO_CLIENT_DECL_PREFIX void NABTO_CLIENT_API nabto_client_stream_read_all(NabtoClientStream* stream, NabtoClientFuture* future, void* buffer, size_t bufferLength, size_t* readLength)
- [in] The stream to read bytes from.
- [in] The future that resolves when the read completes or fails.
- [out] The buffer to put data into. It needs to be kept available until the future resolves.
- [in] The length of the output buffer.
- [out] The actual number of bytes read. It needs to be kept available until the future resolves.
a future which resolves with ok or an error. Future status: NABTO_CLIENT_EC_OK if all or some data was read NABTO_CLIENT_EC_EOF if the stream is eof NABTO_CLIENT_EC_ABORTED if the stream is aborted