YoastSEO_Vendor\GuzzleHttp\Psr7
CachingStream::seek() public Yoast 1.0
{} Это метод класса: CachingStream{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$CachingStream = new CachingStream(); $CachingStream->seek( $offset, $whence );
Код CachingStream::seek() CachingStream::seek Yoast 15.6.2
public function seek($offset, $whence = \SEEK_SET)
{
if ($whence == \SEEK_SET) {
$byte = $offset;
} elseif ($whence == \SEEK_CUR) {
$byte = $offset + $this->tell();
} elseif ($whence == \SEEK_END) {
$size = $this->remoteStream->getSize();
if ($size === null) {
$size = $this->cacheEntireStream();
}
$byte = $size + $offset;
} else {
throw new \InvalidArgumentException('Invalid whence');
}
$diff = $byte - $this->stream->getSize();
if ($diff > 0) {
// Read the remoteStream until we have read in at least the amount
// of bytes requested, or we reach the end of the file.
while ($diff > 0 && !$this->remoteStream->eof()) {
$this->read($diff);
$diff = $byte - $this->stream->getSize();
}
} else {
// We can just do a normal seek since we've already seen this byte.
$this->stream->seek($byte);
}
}