/** * * @see org.apache.wicket.markup.parser.IXmlPullParser#getEncoding() */ public String getEncoding() { return xmlReader.getEncoding(); }
/** * * @see org.apache.wicket.markup.parser.IXmlPullParser#getXmlDeclaration() */ public String getXmlDeclaration() { return xmlReader.getXmlDeclaration(); }
if (getXmlDeclaration(inputStream, readAheadSize)) encoding = determineEncoding(xmlDeclarationString);
/** * 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 * * @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(); } } }
/** * 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 { // The xml parser does not have a parent filter super(); this.inputStream = inputStream; encoding = defaultEncoding; if (inputStream == null) { throw new IllegalArgumentException("Parameter 'inputStream' must not be null"); } init(); }
String xmlDeclaration = getXmlDeclaration(inputStream, readAheadSize); if (!Strings.isEmpty(xmlDeclaration)) encoding = determineEncoding(xmlDeclaration);
/** * 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 * * @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(); } } }
/** * 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 { // The xml parser does not have a parent filter super(); this.inputStream = inputStream; encoding = defaultEncoding; if (inputStream == null) { throw new IllegalArgumentException("Parameter 'inputStream' must not be null"); } init(); }
if (getXmlDeclaration(inputStream, readAheadSize)) encoding = determineEncoding(xmlDeclarationString);
/** * 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(); }
/** * * @see org.apache.wicket.markup.parser.IXmlPullParser#getEncoding() */ public String getEncoding() { return xmlReader.getEncoding(); }
/** * * @see org.apache.wicket.markup.parser.IXmlPullParser#getXmlDeclaration() */ public String getXmlDeclaration() { return xmlReader.getXmlDeclaration(); }