Java - Convert Human Readable Size to Bytes
问题 I've found lots of information about converting raw byte information into a human-readable format, but I need to do the opposite, i.e. convert the String "1.6 GB" into the long value 1717990000. Is there an in-built/well-defined way to do this, or will I pretty much have to roll my own? [Edit]: Here is my first stab... static class ByteFormat extends NumberFormat { @Override public StringBuffer format(double arg0, StringBuffer arg1, FieldPosition arg2) { // TODO Auto-generated method stub