/** * Construct. * * @param inputStream * The InputStream to read the xml data from * @param defaultEncoding * Default character encoding to use when not specified in XML declaration, specify * null to use JVM default * @throws IOException * In case something went wrong while reading the data */ public XmlReader(final InputStream inputStream, final String defaultEncoding) throws IOException { Args.notNull(inputStream, "inputStream"); if (!inputStream.markSupported()) { this.inputStream = new BufferedInputStream(new BOMInputStream(inputStream)); } else { this.inputStream = new BOMInputStream(inputStream); } encoding = defaultEncoding; init(); }