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

{@inheritdoc}
178400
public function seek($offset, $whence = SEEK_SET)
    {
        if (!$this->seekable || $whence !== SEEK_SET) {
            return false;
        }

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

        // Rewind each stream
        foreach ($this->streams as $stream) {
            if (!$stream->seek(0)) {
                $success = false;
            }
        }

        if (!$success) {
            return false;
        }

        // Seek to the actual position by reading from each stream
        while ($this->pos < $offset && !$this->eof()) {
            $this->read(min(8096, $offset - $this->pos));
        }

        return $this->pos == $offset;
    }
450746
protected function seek($where = null)
    {
        if ($where === null) {
            return $this->count;
        }

        $this->count = $where;

        return true;
    }
450113
def seek(self, position):
        
        self._position = position
        range_string = make_range_string(self._position)
        logger.debug('content_length: %r range_string: %r', self._content_length, range_string)

        #
        # Close old body explicitly.
        # When first seek(), self._body is not exist. Catch the exception and do nothing.
        #
        try:
            self._body.close()
        except AttributeError:
            pass

        if position == self._content_length == 0 or position == self._content_length:
            #
            # When reading, we can't seek to the first byte of an empty file.
            # Similarly, we can't seek past the last byte.  Do nothing here.
            #
            self._body = io.BytesIO()
        else:
            self._body = self._object.get(Range=range_string)['Body']
157056
@Override
    public SeekableByteChannel position(final long newPosition) throws IOException {
        // Precondition checks
        if (newPosition > Integer.MAX_VALUE || newPosition < 0) {
            throw new IllegalArgumentException("Valid position for this channel is between 0 and " + Integer.MAX_VALUE);
        }
        synchronized (this) {
            this.position = (int) newPosition;
        }
        return this;
    }
254455
public function seek($offset, $whence = SEEK_SET)
    {
        if ($whence == SEEK_SET) {
            $byte = $offset;
        } elseif ($whence == SEEK_CUR) {
            $byte = $offset + $this->ftell();
        } else {
            throw new RuntimeException(__CLASS__ . ' supports only SEEK_SET and SEEK_CUR seek operations');
        }

        // You cannot skip ahead past where you've read from the remote stream
        if ($byte > $this->body->getSize()) {
            throw new RuntimeException(
                "Cannot seek to byte {$byte} when the buffered stream only contains {$this->body->getSize()} bytes"
            );
        }

        return $this->body->seek($byte);
    }
945410
def seek(self, offset, whence=SEEK_SET):
        """"""

        if whence == SEEK_SET:
            self.__sf.seek(offset)
        elif whence == SEEK_CUR:
            self.__sf.seek(self.tell() + offset)
        elif whence == SEEK_END:
            self.__sf.seek(self.__sf.filesize - offset)
651847
public function seek($position) {
		$index       = $this->getIndexData();
		$maxPosition = count($index) - 1;
		
		if ($position > $maxPosition) {
			$position = $maxPosition;
		}
		
		fseek($this->file, $index[$position]);
		$this->pointer = $position;
	}
358306
async def seek(self, position: int):
        
        if self.current.seekable:
            position = max(min(position, self.current.length), 0)
            await self.node.seek(self.channel.guild.id, position)
922024
public function stream_seek(int $offset, int $whence = SEEK_SET): bool
    {
        return 0 === fseek($this->filePointer, $offset, $whence);
    }
1176462
public function seek($offset, $whence = SEEK_SET)
    {
        if ($whence !== SEEK_SET || $offset < 0) {
            throw new RuntimeException(sprintf(
                'Cannot seek to offset % with whence %s',
                $offset,
                $whence
            ));
        }

        $offset += $this->offset;

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

        $this->stream->seek($offset);
    }
1163494
protected void validatePosition(long position) throws IOException {
    if (position < 0) {
      throw new EOFException(
          String.format(
              "Invalid seek offset: position value (%d) must be >= 0 for '%s'",
              position, resourceIdString));
    }

    if (size >= 0 && position >= size) {
      throw new EOFException(
          String.format(
              "Invalid seek offset: position value (%d) must be between 0 and %d for '%s'",
              position, size, resourceIdString));
    }
  }
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;
    }
184863
public function seek($position)
    {
        if (!isset($this->tokens[$position])) {
            throw $this->getOutOfBoundsException($position);
        }

        $this->position = $position;
    }
508045
public function seek(int $offset, int $whence = \SEEK_SET): int
    {
        if (-1 === fseek($this->handle, $offset, $whence)) {
            $message = 'Could not move file pointer.';
            if ($error = error_get_last()) {
                $message .= sprintf(' Errno: %d; %s', $error['type'], $error['message']);
            }
            throw new FileException($message);
        }

        $position = ftell($this->handle);

        if (false === $position) {
            $message = 'Could not get the file pointer position.';
            if ($error = error_get_last()) {
                $message .= sprintf(' Errno: %d; %s', $error['type'], $error['message']);
            }
            throw new FileException($message);
        }

        return $position;
    }
238214
def seek(self, pos=0):
        
        if pos - self.pos >= 0:
            blocks, remainder = divmod(pos - self.pos, self.bufsize)
            for i in range(blocks):
                self.read(self.bufsize)
            self.read(remainder)
        else:
            raise StreamError("seeking backwards is not allowed")
        return self.pos
1266008
def seek( self, offset, whence=0 ):
        
        # Determine absolute target position
        if whence == 0:
            target_pos = offset
        elif whence == 1:
            target_pos = self.file_pos + offset
        elif whence == 2:
            target_pos = self.size - offset
        else:
            raise Exception( "Invalid `whence` argument: %r", whence )
        # Check if this is a noop
        if target_pos == self.file_pos:
            return    
        # Verify it is valid
        assert 0 <= target_pos < self.size, "Attempt to seek outside file"
        # Move the position
        self.file_pos = target_pos
        # Mark as dirty, the next time a read is done we need to actually
        # move the position in the bzip2 file
        self.dirty = True
371619
public function seek($offset, $whence = SEEK_SET)
    {
        if (!$this->_seekable) {
            throw new RuntimeException("Cannot seek on non seekable stream.");
        }
        if ($whence !== SEEK_SET) {
            if (!$offset && $whence === SEEK_END) {
                return $this->end();
            }
            throw new InvalidArgumentException("This seek operation is not supported on a multi stream container.");
        }
        $this->_offset = $this->_current = 0;

        foreach ($this->_streams as $i => $stream) {
            $stream->rewind();
        }

        while ($this->_offset < $offset && !$this->eof()) {
            $result = $this->read(min(8096, $offset - $this->_offset));
            if ($result === '') {
                break;
            }
        }
    }