function Stream::seek
Overrides StreamInterface::seek
2 calls to Stream::seek()
- Stream::rewind in vendor/
guzzlehttp/ psr7/ src/ Stream.php - Seek to the beginning of the stream.
- Stream::__toString in vendor/
guzzlehttp/ psr7/ src/ Stream.php - Reads all data from the stream into a string, from the beginning to end.
File
-
vendor/
guzzlehttp/ psr7/ src/ Stream.php, line 201
Class
- Stream
- PHP stream implementation.
Namespace
GuzzleHttp\Psr7Code
public function seek($offset, $whence = SEEK_SET) : void {
$whence = (int) $whence;
if (!isset($this->stream)) {
throw new \RuntimeException('Stream is detached');
}
if (!$this->seekable) {
throw new \RuntimeException('Stream is not seekable');
}
if (fseek($this->stream, $offset, $whence) === -1) {
throw new \RuntimeException('Unable to seek to stream position ' . $offset . ' with whence ' . var_export($whence, true));
}
}