code: protected final String parseSystemId(char quoteChar, boolean convertLFs,
                                           String errorMsg)
          throws XMLStreamException
      {
          char[] buf = getNameBuffer(-1);
          int ptr = 0;
  
          while (true) {
              char c = (mInputPtr < mInputEnd) ?
                  mInputBuffer[mInputPtr++] : getNextChar(errorMsg);
              if (c == quoteChar) {
                  break;
              }
              /* ??? 14-Jun-2004, TSa: Should we normalize linefeeds or not?
               *   It seems like we should, for all input... so that's the way it
               *   works.
               */
              if (c == '\n') {
                  markLF();
              } else if (c == '\r') {
                  if (peekNext() == '\n') {
                      ++mInputPtr;
                      if (!convertLFs) {
                          /* The only tricky thing; need to preserve 2-char LF; need to
                           * output one char from here, then can fall back to default:
                           */
                          if (ptr >= buf.length) {
                              buf = expandBy50Pct(buf);
                          }
                          buf[ptr++] = '\r';
                      }
                      c = '\n';
                  } else if (convertLFs) {
                      c = '\n';
                  }
              }
  
              // Other than that, let's just append it:
              if (ptr >= buf.length) {
                  buf = expandBy50Pct(buf);
              }
              buf[ptr++] = c;
          }
  
          return (ptr == 0) ? "" : new String(buf, 0, ptr);
      }
docs: Simple parsing method that parses system ids, which are generally
  used in entities (from DOCTYPE declaration to internal/external
  subsets).
  <p>
  NOTE: returned String is not canonicalized, on assumption that
  external ids may be longish, and are not shared all that often, as
  they are generally just used for resolving paths, if anything.
  <br />
  Also note that this method is not heavily optimized, as it's not
  likely to be a bottleneck for parsing.