A library providing the famous "human readable bytes" StackOverflow answer.
implementation "cl.emilym:bytes:<latest>"
long fileSize = 10_000;
// Prints "The size of the file is 10kB"
System.out.println("The size of the file is " + HumanReadableBytes.si(fileSize));
// Prints "The size of the file is 9.8KiB"
System.out.println("The size of the file is " + HumanReadableBytes.bi(fileSize));