public static ByteSizeUnit fromShortName(String shortName) {
        ByteSizeUnit val = shortNameToEnumMap.get(CaseInsensitiveString.fromString(shortName));
        if (val == null) {
            String allShortNames = Arrays.stream(ByteSizeUnit.values())
                    .map(byteSizeUnit -> {
                        return byteSizeUnit.shortName;
                    })
                    .collect(Collectors.joining(", "));
            throw new IllegalArgumentException(String.format(
                    "ShortName [%s] is not valid. Should be one of [%s] (case insensitive).",
                    shortName,
                    allShortNames));
        }
        return val;
    }
Utility class for handling byte size units such as MiB, GiB, TiB etc.
stroom-util/src/main/java/stroom/util/io/ByteSizeUnit.java