class BdbDumpFile implements StoreLoader {

    @Override
    public void load(final Path inputFile) throws IOException {

        //Handles both non-regular files and non-existent files
        if (!Files.isRegularFile(inputFile)) {
            throw new IllegalArgumentException(inputFile.toString() + " doesn't exist or is not a file");
        }

        this.reader = Files.newBufferedReader(inputFile);

        final String firstKey;
        while (true) {
            final String line = reader.readLine();

            if (line == null) {
                //apparently there was nothing in this file, close and return
                this.nextEntry = null;
                this.reader.close();
                return;
            }

            if (line.startsWith(" ")) {
                //found the first data entry, stop looping over the headers
                firstKey = line;
                break;
            }
        }

        final String firstValue = reader.readLine();

        this.nextEntry = new DataEntry(
            Base64.getDecoder().decode(Hex.decode(firstKey.trim())),
            new ByteArrayInputStream(Hex.decode(firstValue))
        );
    }

}