if (doc instanceof HTMLDocument) { Parser parser = getParser(); if (pos < 0 || pos > doc.getLength()) throw new BadLocationException("Bad location", pos); if (parser == null) throw new IOException("Parser is null.");  HTMLDocument hd = ((HTMLDocument) doc); hd.setBase(editorPane.getPage()); ParserCallback pc = hd.getReader(pos);     parser.parse(in, pc, false); pc.flush(); } else   super.read(in, doc, pos);
  public void read(Reader in, Document doc, int pos) throws IOException,      BadLocationException  {    // FIXME: Not implemented.  }