protected function readMetadata()
    {
        if ($this->metadata !== null) {
            return;
        }

        $line = fgets($this->getFileHandler());

        if (trim($line) !== '[') {
            throw new \InvalidArgumentException('Given file does not match expected pattern.');
        }

        $line = trim(fgets($this->getFileHandler()));
        $this->metadata = json_decode(rtrim($line, ','), true);
    }