How can I convert byte size into a human-readable format in Java?
Like 1024 should become "1 Kb" and 1024*1024 should become "1 Mb".
I am kind of sick of writing this utility method for each project. Is there a static method in Apache Commons for this?
Source: Formatting byte size to human readable format | Programming.Guide
SI (1 k = 1,000)
Binary (1 Ki = 1,024)
Example output: