Package org.codehaus.stax2

Examples of org.codehaus.stax2.XMLInputFactory2.createXMLStreamReader()


        throws IOException, XMLStreamException
    {
        // Let's ensure it's a new factory, to minimize caching probs
        XMLInputFactory2 f = getNewInputFactory();
        if (enc == null) { // reader-based
            return (XMLStreamReader2) f.createXMLStreamReader(new StringReader(content));
        }
        // nope, byte based
        byte[] data = content.getBytes(enc);
        return (XMLStreamReader2) f.createXMLStreamReader(new ByteArrayInputStream(data));
    }
View Full Code Here


        if (enc == null) { // reader-based
            return (XMLStreamReader2) f.createXMLStreamReader(new StringReader(content));
        }
        // nope, byte based
        byte[] data = content.getBytes(enc);
        return (XMLStreamReader2) f.createXMLStreamReader(new ByteArrayInputStream(data));
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.