/** * 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(); } } }
/** * Reads and parses markup from an input stream. * <p> * Note: The input is closed after parsing. * * @param inputStream * The input stream to read and parse * @param encoding * The default character encoding of the input * @throws IOException */ @Override public void parse(final InputStream inputStream, final String encoding) throws IOException { Args.notNull(inputStream, "inputStream"); try { XmlReader xmlReader = new XmlReader(new BufferedInputStream(inputStream, 4000), encoding); this.input = new FullyBufferedReader(xmlReader); this.encoding = xmlReader.getEncoding(); } finally { IOUtils.closeQuietly(inputStream); } }
/** * Reads and parses markup from an input stream. * <p> * Note: The input is closed after parsing. * * @param inputStream * The input stream to read and parse * @param encoding * The default character encoding of the input * @throws IOException */ @Override public void parse(final InputStream inputStream, final String encoding) throws IOException { Args.notNull(inputStream, "inputStream"); try { XmlReader xmlReader = new XmlReader(new BufferedInputStream(inputStream, 4000), encoding); this.input = new FullyBufferedReader(xmlReader); this.encoding = xmlReader.getEncoding(); } finally { IOUtils.closeQuietly(inputStream); } }