Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Stream.php

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\Psr7

Code

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));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal