Built-in storage unit conversions utilty in Java?
java, units-of-measurement
Solution
Check out JSR-275. Depending on what you want to do, might be a bit of an overkill. Or you could take a look at Commons Monitoring. They deal with some storage units I think, but again, the library itself is probably too much when want just the class.
Problem
there doesn't seem to be an existing util class for converting a storage unit from one to another in Java, am I right? Or is there one actually I wasn't aware of? What I was looking for is something like java.util.concurrent.TimeUnit utility. I can implement the equivalent for storage unit by myself, but just thought I would ask first before reinventing the wheel. Thanks.