public void readDump ( ) throws IOException { try { SAXParserFactory factory = SAXParserFactory . newInstance ( ) ; factory . setFeature ( XMLConstants . FEATURE_SECURE_PROCESSING , false ) ; SAXParser parser = factory . newSAXParser ( ) ; parser . parse ( input , this ) ; } catch ( ParserConfigurationException e ) { throw ( IOException ) new IOException ( e . getMessage ( ) ) . initCause ( e ) ; } catch ( SAXException e ) { throw ( IOException ) new IOException ( e . getMessage ( ) ) . initCause ( e ) ; } writer . close ( ) ; }
Reads through the entire XML dump on the input stream sending events to the DumpWriter as it goes . May throw exceptions on invalid input or due to problems with the output .