src/Text/TextReader.php
public function readAll(int $maxlength = 0, float $timeout = 0): \Generator
    {
        $this->buffer->push(yield from Stream\readAll($this->stream, $maxlength, $timeout));
        return $this->buffer->shift(strlen(mb_strcut((string) $this->buffer, 0, null, $this->encoding)));
    }
public function readAll(int $maxlength = 0, float $timeout = 0): \Generator
    {
        $this->buffer->push(yield from Stream\readAll($this->stream, $maxlength, $timeout));
        return $this->buffer->shift(strlen(mb_strcut((string) $this->buffer, 0, null, $this->encoding)));
    }
@coroutine

Reads all characters from the stream until the end of the stream is reached.

If the stream ends in the middle of a character, the left over bytes will be discarded.

@param int $maxLength The maximum number of bytes to read.
@param float|int $timeout Number of seconds until the returned promise is rejected with a TimeoutException
if no data is received. Use 0 for no timeout.

@return \Generator

@resolve string The contents of the stream.

@throws \Icicle\Awaitable\Exception\TimeoutException If the operation times out.
@throws \Icicle\Stream\Exception\UnreadableException If the stream is no longer readable.
@throws \Icicle\Stream\Exception\ClosedException If the stream is unexpectedly closed.