public String asPrettyString() {
        if (bytes == 0) return "0 bytes";
        if (bytes == 1) return "1 byte";
        long remaining = bytes;
        int unit = 0;
        for (; remaining % 1024 == 0 && unit < Unit.values().length - 1; unit++) remaining /= 1024;
        return String.format(Locale.ENGLISH, "%d %s", remaining, Unit.values()[unit].toUnitString());
    }
Reprents a quantity of bytes with a human-readable string representation.
Currently only supports binary units (e.g. 1 kB = 1024 bytes).

@author bjorncs
vespajlib/src/main/java/ai/vespa/utils/BytesQuantity.java