code: public static final long resolveUnit(String string) throws NumberFormatException {
  		if (string == null || "null".equals(string)) {
  			return 0l;
  		}
  		StringBuffer buffer = new StringBuffer(string.toLowerCase());
  
  		// eg. 1KByte -> 1024byte
  		long unit = resolveUnit(buffer);
  		String number = buffer.toString().trim();
  		number = number.replace(',', '.');
  		int i = number.indexOf('.');
  		if (i > -1) {
  			number = number.substring(0, i);
  		}
  		if (number.length() == 0) {
  			return 0;
  		}
  		long value = Long.parseLong(number);
  		if (unit != 1) {
  			value *= unit;
  		}
  		return value;
  	}
docs: --- UNIT PARSER ---