public Map<FlagId, FlagData> read() {
        Optional<byte[]> bytes = readFile();
        if (!bytes.isPresent()) return Map.of();
        return FlagData.deserializeList(bytes.get()).stream().collect(Collectors.toMap(FlagData::id, Function.identity()));
    }
Java API for a flag database stored in a single file

@author hakonhall
flags/src/main/java/com/yahoo/vespa/flags/file/FlagDbFile.java