def METHOD_NAME(self, offset, whence=io.SEEK_SET):
    # Recalculate offset as an absolute file position.
    if whence == io.SEEK_SET:
        pass
    elif whence == io.SEEK_CUR:
        offset = self._pos + offset
    elif whence == io.SEEK_END:
        # Seeking relative to EOF - we need to know the file's size.
        if self._size < 0:
            while self.read(io.DEFAULT_BUFFER_SIZE):
                pass
        offset = self._size + offset
    else:
        raise ValueError("Invalid value for whence: {}".format(whence))
    # Make it so that offset is the number of bytes to skip forward.
    if offset < self._pos:
        self._rewind()
    else:
        offset -= self._pos
    # Read and discard data until we reach the desired position.
    while offset > 0:
        data = self.read(min(io.DEFAULT_BUFFER_SIZE, offset))
        if not data:
            break
        offset -= len(data)
    return self._pos