public Reader openStream(String publicID, String systemID) throws MalformedURLException, FileNotFoundException, IOException {
    URL url = new URL(currentReader.systemId, systemID);

    if (url.getRef() != null) {
      String ref = url.getRef();

      if (!url.getFile().isEmpty()) {
        url = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getFile());
        url = new URL("jar:" + url + '!' + ref);
      }
      else {
        url = StdXMLReader.class.getResource(ref);
      }
    }

    currentReader.publicId = publicID;
    currentReader.systemId = url;
    StringBuilder charsRead = new StringBuilder();
    Reader reader = stream2reader(url.openStream(), charsRead);

    if (charsRead.length() == 0) {
      return reader;
    }

    String charsReadStr = charsRead.toString();
    PushbackReader pbreader = new PushbackReader(reader, charsReadStr.length());

    for (int i = charsReadStr.length() - 1; i >= 0; i--) {
      pbreader.unread(charsReadStr.charAt(i));
    }

    return pbreader;
  }
public Reader openStream(String publicID, String systemID)