public function setFile(string $filePath): self
    {
        if (!file_exists($filePath)) {
            throw new MimeDetectorException("File '" . $filePath . "' does not exist.");
        }

        $this->stream = $this->readFile($filePath);
        $this->createByteCache();
        return $this;
    }