• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/web/http/stream.php
  • Класс: BitrixMainWebHttpStream
  • Вызов: Stream::seek
public function seek(int $offset, int $whence = SEEK_SET): void
{
	if (!$this->resource)
	{
		throw new RuntimeException('No resource available, cannot seek position.');
	}

	if (!$this->isSeekable())
	{
		throw new RuntimeException('Stream is not seekable.');
	}

	$result = fseek($this->resource, $offset, $whence);

	if ($result !== 0)
	{
		throw new RuntimeException('Error seeking within stream.');
	}
}