src/Valkyrja/HttpMessage/NativeStream.php
public function seek(int $offset, int $whence = SEEK_SET): void
    {
        // If there is no stream
        if (null === $this->stream) {
            // Throw a new runtime exception
            throw new RuntimeException(
                'No resource available; cannot seek position'
            );
        }

        // If the stream isn't seekable
        if (! $this->isSeekable()) {
            // Throw a new runtime exception
            throw new RuntimeException(
                'Stream is not seekable'
            );
        }

        // Get the results of the seek attempt
        $result = fseek($this->stream, $offset, $whence);

        // If the result was not a 0, denoting an error occurred
        if (0 !== $result) {
            // Throw a new runtime exception
            throw new RuntimeException(
                'Error seeking within stream'
            );
        }
    }
public function seek(int $offset, int $whence = SEEK_SET): void
    {
        // If there is no stream
        if (null === $this->stream) {
            // Throw a new runtime exception
            throw new RuntimeException(
                'No resource available; cannot seek position'
            );
        }

        // If the stream isn't seekable
        if (! $this->isSeekable()) {
            // Throw a new runtime exception
            throw new RuntimeException(
                'Stream is not seekable'
            );
        }

        // Get the results of the seek attempt
        $result = fseek($this->stream, $offset, $whence);

        // If the result was not a 0, denoting an error occurred
        if (0 !== $result) {
            // Throw a new runtime exception
            throw new RuntimeException(
                'Error seeking within stream'
            );
        }
    }
Seek to a position in the stream.

@link http://www.php.net/manual/en/function.fseek.php

@param int $offset Stream offset
@param int $whence Specifies how the cursor position will be calculated
based on the seek offset. Valid values are identical
to the built-in PHP $whence values for `fseek()`.
SEEK_SET: Set position equal to offset bytes
SEEK_CUR: Set position to current location plus
offset SEEK_END: Set position to end-of-stream plus
offset.

@throws \RuntimeException on failure.

@return void