docs: public static long parseBytes(String input, ConfigOrigin originForException,
              String pathForException) {
          String s = ConfigImplUtil.unicodeTrim(input);
          String unitString = getUnits(s);
          String numberString = ConfigImplUtil.unicodeTrim(s.substring(0,
                  s.length() - unitString.length()));
  
          // this would be caught later anyway, but the error message
          // is more helpful if we check it here.
          if (numberString.length() == 0)
              throw new ConfigException.BadValue(originForException,
                      pathForException, "No number in size-in-bytes value '"
                              + input + "'");
  
          MemoryUnit units = MemoryUnit.parseUnit(unitString);
  
          if (units == null) {
              throw new ConfigException.BadValue(originForException, pathForException,
                      "Could not parse size-in-bytes unit '" + unitString
                              + "' (try k, K, kB, KiB, kilobytes, kibibytes)");
          }
  
          try {
              // if the string is purely digits, parse as an integer to avoid
              // possible precision loss; otherwise as a double.
              if (numberString.matches("[0-9]+")) {
                  return Long.parseLong(numberString) * units.bytes;
              } else {
                  return (long) (Double.parseDouble(numberString) * units.bytes);
              }
          } catch (NumberFormatException e) {
              throw new ConfigException.BadValue(originForException, pathForException,
                      "Could not parse size-in-bytes number '" + numberString + "'");
          }
      }