code: public static long parseParametersForSizeLimit(Map<String, String> parameters)
              throws JournalException {
          String sizeString =
                  getOptionalStringParameter(parameters,
                                             PARAMETER_JOURNAL_FILE_SIZE_LIMIT,
                                             DEFAULT_SIZE_LIMIT);
          Pattern p = Pattern.compile("([0-9]+)([KMG]?)");
          Matcher m = p.matcher(sizeString);
          if (!m.matches()) {
              throw new JournalException("Parameter '"
                      + PARAMETER_JOURNAL_FILE_SIZE_LIMIT
                      + "' must be an integer number of bytes, "
                      + "optionally followed by 'K', 'M', or 'G', "
                      + "or a 0 to indicate no size limit");
          }
          long size = Long.parseLong(m.group(1));
          String factor = m.group(2);
          if ("K".equals(factor)) {
              size *= 1024;
          } else if ("M".equals(factor)) {
              size *= 1024 * 1024;
          } else if ("G".equals(factor)) {
              size *= 1024 * 1024 * 1024;
          }
          return size;
      }
docs: Get the size limit parameter (or let it default), and convert it to
  bytes.