Matthew F. answered 04/05/19
Professional Software/ Web Developer Specializing in Java
While I don't know if apache commons has anything like this, but you can easily write a static helper class that has this function inside of it:
This will continually divide the input double bytes until it becomes lower than the threshold, and each division will increase the index of the String array that holds the units.