Attempts to seek to the given position. Only supports SEEK_SET.

{@inheritdoc}
161860
public function seek($offset, $whence = SEEK_SET)
    {
        if (!$this->seekable) {
            throw new \RuntimeException('This AppendStream is not seekable');
        } elseif ($whence !== SEEK_SET) {
            throw new \RuntimeException('The AppendStream can only seek with SEEK_SET');
        }

        $this->pos = $this->current = 0;

        // Rewind each stream
        foreach ($this->streams as $i => $stream) {
            try {
                $stream->rewind();
            } catch (\Exception $e) {
                throw new \RuntimeException('Unable to seek stream '
                    . $i . ' of the AppendStream', 0, $e);
            }
        }

        // Seek to the actual position by reading from each stream
        while ($this->pos < $offset && !$this->eof()) {
            $result = $this->read(min(8096, $offset - $this->pos));
            if ($result === '') {
                break;
            }
        }
    }
1109376
public function seek($iOffset)
    {
        $this->rewind();
        $iPosition = 0;

        while ($iPosition < $iOffset and true === $this->valid()) {
            $this->next();
            $iPosition++;
        }

        if (false === $this->valid()) {
            throw new \OutOfBoundsException('Invalid seek position: ' . $iOffset);
        }

        return $this->current();
    }
406115
def seek(self, offset, whence=0):
        """"""
        if self._offset:
            if whence == 0:
                self._fh.seek(self._offset + offset, whence)
                return
            if whence == 2 and self._size > 0:
                self._fh.seek(self._offset + self._size + offset, 0)
                return
        self._fh.seek(offset, whence)
1133123
public void seek(final int position) throws IOException {
        if (position < 0) {
            throw new IllegalArgumentException("position < 0: " + position);
        }
        if (position > size) {
            throw new EOFException();
        }
        this.pointer = position;
    }
587386
public function seek(int $offset, int $whence = Seekable::SET)
    {
        switch ($whence) {
            case Seekable::SET:
                $this->position = $offset;
                break;

            case Seekable::CURRENT:
                $this->position += $offset;
                break;

            case Seekable::END:
                $this->position = strlen($this->buffer) + $offset;
                break;

            default:
                throw new \InvalidArgumentException(
                        'Wrong value for $whence, must be one of Seekable::SET,'
                        . ' Seekable::CURRENT or Seekable::END.'
                );
        }
    }
509311
public function seek($position): void
    {
        $args = [$position];
        $methodName = __FUNCTION__;

        $this->findAndCall($methodName, $args);
    }
46682
function _stream_seek($offset, $whence)
    {
        switch ($whence) {
            case SEEK_SET:
                if ($offset >= $this->size || $offset < 0) {
                    return false;
                }
                break;
            case SEEK_CUR:
                $offset+= $this->pos;
                break;
            case SEEK_END:
                $offset+= $this->size;
        }

        $this->pos = $offset;
        $this->eof = false;
        return true;
    }
1120326
def seek(self, amount, reference="relative", precision="default-precise"):
        """"""
        self.command('seek', amount, reference, precision)
306487
def seek(self, offset, whence=os.SEEK_SET):
        """"""

        pos = None
        if whence == os.SEEK_SET:
            pos = self.offset + offset
        elif whence == os.SEEK_CUR:
            pos = self.tell() + offset
        elif whence == os.SEEK_END:
            pos = self.offset + self.len + offset
        else:
            raise ValueError("invalid whence {}".format(whence))

        if pos > self.offset + self.len or pos < self.offset:
            raise ValueError("seek position beyond chunk area")

        self.parent_fd.seek(pos, os.SEEK_SET)
27801
@Override
  public synchronized void seek(long pos) throws IOException {
    long startTime = System.nanoTime();
    logger.atFine().log("seek: %d", pos);
    try {
      channel.position(pos);
    } catch (IllegalArgumentException e) {
      throw new IOException(e);
    }
    long duration = System.nanoTime() - startTime;
    ghfs.increment(GoogleHadoopFileSystemBase.Counter.SEEK);
    ghfs.increment(GoogleHadoopFileSystemBase.Counter.SEEK_TIME, duration);
  }
472006
public function seek($offset, $whence = SEEK_SET)
    {
        if ($whence != SEEK_SET) {
            return false;
        }

        if ($offset < $this->offset) {
            $offset = $this->offset;
        }

        if ($this->limit !== -1 && $offset > ($this->offset + $this->limit)) {
            $offset = $this->offset + $this->limit;
        }

        return $this->stream->seek($offset);
    }
29444
public function setOffset($offset)
    {
        $current = $this->stream->tell();

        if ($current !== $offset) {
            // If the stream cannot seek to the offset position, then read to it
            if (!$this->stream->seek($offset)) {
                if ($current > $offset) {
                    throw new SeekException($this, $offset);
                } else {
                    $this->stream->read($offset - $current);
                }
            }
        }

        $this->offset = $offset;

        return $this;
    }
1308717
private function seek($offset, $whence = SEEK_SET)
    {
        if (-1 === @fseek($this->getHandle(), $offset, $whence)) {
            throw new RuntimeException(
                "Could not seek to $offset in \"{$this->file}\"."
            );
        }
    }
298664
public function seek($position)
    {
        $position = (int) $position;
        if ($position < 0 || $position >= $this->_count) {
            throw new Kwf_Exception("Illegal index $position");
        }
        $this->_pointer = $position;
        return $this;
    }
683650
public function seek($offset, $whence = SEEK_SET)
    {
        if (!is_int($offset) && !is_numeric($offset)) {
            return false;
        }

        $offset = (int) $offset;
        if ($offset < 0) {
            return false;
        }

        $key = $this->iterator->key();
        if (!is_int($key) && !is_numeric($key)) {
            $key = 0;
            $this->iterator->rewind();
        }

        if ($key >= $offset) {
            $key = 0;
            $this->iterator->rewind();
        }

        while ($this->iterator->valid() && $key < $offset) {
            $this->iterator->next();
            ++$key;
        }

        $this->position = $key;

        return true;
    }
340145
public function seek($position)
    {
        $this->rewind();
        for ($i=0; $i<$position; $i++) {
            $this->next();
        }
        if (!$this->valid()) {
            throw new \OutOfBoundsException(
                sprintf('Invalid seek position "%s"!', $position)
            );
        }
    }
496251
public function set_seek_position($position)
    {
        $this->seek_position = isset($position) ? (integer)$position : null;

        return $this;
    }