public void read(InputStream in) throws IOException {
  IXMLParser parser;
  try {
    parser=XMLParserFactory.createDefaultXMLParser();
  }
 catch (  Exception ex) {
    InternalError e=new InternalError("Unable to instantiate NanoXML Parser");
    e.initCause(ex);
    throw e;
  }
  IXMLReader reader=new StdXMLReader(in);
  parser.setReader(reader);
  IXMLElement document;
  try {
    document=(IXMLElement)parser.parse();
  }
 catch (  XMLException ex) {
    IOException e=new IOException(ex.getMessage());
    e.initCause(ex);
    throw e;
  }
  read(document);
}

public void read ( InputStream in ) throws IOException { IXMLParser parser ; try { parser = XMLParserFactory . createDefaultXMLParser ( ) ; } catch ( Exception ex ) { InternalError e = new InternalError ( "Unable to instantiate NanoXML Parser" ) ; e . initCause ( ex ) ; throw e ; } IXMLReader reader = new StdXMLReader ( in ) ; parser . setReader ( reader ) ; IXMLElement document ; try { document = ( IXMLElement ) parser . parse ( ) ; } catch ( XMLException ex ) { IOException e = new IOException ( ex . getMessage ( ) ) ; e . initCause ( ex ) ; throw e ; } read ( document ) ; }
reads a & lt ; document - styles & gt ; element from the specified input stream .
