private function findOffset()
    {
        $this->seek(0);

        $offset = 0;

        while (!$this->isEndOfFile()) {
            if (strtolower($this->read(1)) === self::$sequence[$offset]) {
                $offset++;
            } else {
                $offset = 0;
            }

            if (!isset(self::$sequence[$offset + 1])) {
                break;
            }
        }

        $this->seek(1, SEEK_CUR);

        if ($offset === (count(self::$sequence) - 1)) {
            $position = $this->getPosition();

            if ("\r\n" === $this->read(2)) {
                return $position + 2;
            }

            return $position;
        }

        return null;
    }