Search in sources :

Example 1 with StAXDocumentParser

use of com.sun.xml.fastinfoset.stax.StAXDocumentParser in project cxf by apache.

the class FIStaxInInterceptor method getParser.

private XMLStreamReader getParser(InputStream in) {
    StAXDocumentParser parser = new StAXDocumentParser(in);
    parser.setStringInterning(true);
    parser.setForceStreamClose(true);
    parser.setInputStream(in);
    return parser;
}
Also used : StAXDocumentParser(com.sun.xml.fastinfoset.stax.StAXDocumentParser)

Example 2 with StAXDocumentParser

use of com.sun.xml.fastinfoset.stax.StAXDocumentParser in project cxf by apache.

the class TunedDocumentLoader method loadFastinfosetDocument.

static Document loadFastinfosetDocument(URL url) throws IOException, ParserConfigurationException, XMLStreamException {
    try (InputStream in = new BufferedInputStream(url.openStream())) {
        XMLStreamReader staxReader = new StAXDocumentParser(in);
        W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
        StaxUtils.copy(staxReader, writer);
        staxReader.close();
        return writer.getDocument();
    }
}
Also used : W3CDOMStreamWriter(org.apache.cxf.staxutils.W3CDOMStreamWriter) XMLStreamReader(javax.xml.stream.XMLStreamReader) StAXDocumentParser(com.sun.xml.fastinfoset.stax.StAXDocumentParser) BufferedInputStream(java.io.BufferedInputStream) BufferedInputStream(java.io.BufferedInputStream) InputStream(java.io.InputStream)

Aggregations

StAXDocumentParser (com.sun.xml.fastinfoset.stax.StAXDocumentParser)2 BufferedInputStream (java.io.BufferedInputStream)1 InputStream (java.io.InputStream)1 XMLStreamReader (javax.xml.stream.XMLStreamReader)1 W3CDOMStreamWriter (org.apache.cxf.staxutils.W3CDOMStreamWriter)1