All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netease.cloud.util.XmlUtils Maven / Gradle / Ivy

The newest version!
package com.netease.cloud.util;

import java.io.IOException;
import java.io.InputStream;

import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;

public class XmlUtils {

    public static XMLReader parse(InputStream in, ContentHandler handler)
            throws SAXException, IOException {

        XMLReader reader = XMLReaderFactory.createXMLReader();
        reader.setContentHandler(handler);
        reader.parse(new InputSource(in));
        in.close();
        return reader;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy