WordPress\AiClientDependencies\Nyholm\Psr7

Stream::seekpublicWP 1.0

Method of the class: Stream{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Stream = new Stream();
$Stream->seek( $offset, $whence ): void;
$offset(required)
.
$whence
.
Default: \SEEK_SET

Stream::seek() code WP 7.0

public function seek($offset, $whence = \SEEK_SET): void
{
    if (!isset($this->stream)) {
        throw new \RuntimeException('Stream is detached');
    }
    if (!$this->seekable) {
        throw new \RuntimeException('Stream is not seekable');
    }
    if (-1 === \fseek($this->stream, $offset, $whence)) {
        throw new \RuntimeException('Unable to seek to stream position "' . $offset . '" with whence ' . \var_export($whence, \true));
    }
}