Reads all available elements from an input stream, and collects them in an allocated buffer. If calling hasData() on the return value of this function returns true, you need to free that data yourself, as it has been allocated via malloc.
The stream to read from.
Either the data that was read, as a malloc'd buffer that should be freed with free(result.data.ptr), or a StreamError if something went wrong.
See Implementation
Reads all available elements from an input stream, and collects them in an allocated buffer. If calling hasData() on the return value of this function returns true, you need to free that data yourself, as it has been allocated via malloc.