src/Text/TextReader.php
public function read(int $length = 1, float $timeout = 0): \Generator
    {
        return $this->buffer->shift(strlen(yield from $this->peek($length, $timeout)));
    }
public function read(int $length = 1, float $timeout = 0): \Generator
    {
        return $this->buffer->shift(strlen(yield from $this->peek($length, $timeout)));
    }
@coroutine

Reads a specific number of characters from the stream.

@param int $length The number of characters 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 String of characters read from 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.