@Override
  public void close() throws IOException {
    try {
      int bufferLength = buffer.length();

      for (; ; ) {
        String str;
        char ch;

        if (bufferIndex >= bufferLength) {
          str = XMLUtil.read(reader, '&');
          ch = str.charAt(0);
        }
        else {
          bufferIndex++;
          continue; // don't interpret chars in the buffer
        }

        if (ch == '<') {
          reader.unread(ch);
          break;
        }

        if ((ch == '&') && (str.length() > 1)) {
          if (str.charAt(1) != '#') {
            XMLUtil.processEntity(str, reader, resolver);
          }
        }
      }
    }
    catch (XMLParseException e) {
      throw new IOException(e.getMessage());
    }
  }
@Override
  public void close()