/** * Reads and parses markup from an input stream * * @param inputStream * The input stream to read and parse * @param encoding * The default character encoding of the input * @throws IOException * @throws ResourceStreamNotFoundException */ public void parse(final InputStream inputStream, final String encoding) throws IOException, ResourceStreamNotFoundException { try { xmlReader = new XmlReader(new BufferedInputStream(inputStream, 4000), encoding); input = new FullyBufferedReader(xmlReader); } finally { inputStream.close(); if (xmlReader != null) { xmlReader.close(); } } }
/** * Reads and parses markup from an input stream * * @param inputStream * The input stream to read and parse * @param encoding * The default character encoding of the input * @throws IOException * @throws ResourceStreamNotFoundException */ public void parse(final InputStream inputStream, final String encoding) throws IOException, ResourceStreamNotFoundException { try { xmlReader = new XmlReader(new BufferedInputStream(inputStream, 4000), encoding); input = new FullyBufferedReader(xmlReader); } finally { inputStream.close(); if (xmlReader != null) { xmlReader.close(); } } }