WordPress\AiClientDependencies\Nyholm\Psr7
Stream::read
Method of the class: Stream{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Stream = new Stream(); $Stream->read( $length ): string;
- $length(required)
- .
Stream::read() 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;
}