Asked • 04/03/19

How to convert byte size into human readable format in java?

How to convert byte size into 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. Are there any static methods in Apache Commons for this?

1 Expert Answer

By:

Matthew F. answered • 04/05/19

Tutor
New to Wyzant

Professional Software/ Web Developer Specializing in Java

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.