WordPress\AiClientDependencies\Nyholm\Psr7

Stream::readpublicWP 1.0

Method of the class: Stream{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Stream = new Stream();
$Stream->read( $length ): string;
$length(required)
.

Stream::read() code WP 7.0

public function read($length): string
{
    if (!isset($this->stream)) {
        throw new \RuntimeException('Stream is detached');
    }
    if (!$this->readable) {
        throw new \RuntimeException('Cannot read from non-readable stream');
    }
    if (\false === $result = @\fread($this->stream, $length)) {
        throw new \RuntimeException('Unable to read from stream: ' . (\error_get_last()['message'] ?? ''));
    }
    return $result;
}