public function seek($offset, $whence = SEEK_SET)
    {
        $position = $this->calculatePosition($offset, $whence);

        if (!isset($this->cursor) || $position < $this->cursor) {
            $this->getEncoder()->rewind();
            $this->buffer = '';
            $this->cursor = 0;
        }

        $this->forward($position);
    }