private static void parse(InputStream in,Encoding encoding,ContentHandler contentHandler) throws IOException, SAXException {
  try {
    XMLReader reader=new ExpatReader();
    reader.setContentHandler(contentHandler);
    InputSource source=new InputSource(in);
    source.setEncoding(encoding.expatName);
    reader.parse(source);
  }
 catch (  IOException e) {
    throw new AssertionError(e);
  }
}

private static void parse ( InputStream in , Encoding encoding , ContentHandler contentHandler ) throws IOException , SAXException { try { XMLReader reader = new ExpatReader ( ) ; reader . setContentHandler ( contentHandler ) ; InputSource source = new InputSource ( in ) ; source . setEncoding ( encoding . expatName ) ; reader . parse ( source ) ; } catch ( IOException e ) { throw new AssertionError ( e ) ; } }
parses xml from the given input stream and fires events on the given sax handler .
