开发者

Android: can not import org.apache.harmony.xml.ExpatReader

开发者 https://www.devze.com 2023-01-04 22:27 出处:网络
I need to parse an UTF-8 encoded input stream, so I think the most appropriate method is to use XMLReader reader = new ExpatReader();

I need to parse an UTF-8 encoded input stream, so I think the most appropriate method is to use

    XMLReader reader = new ExpatReader();
    InputSource source = new InputSource(in);
    source.setEncoding(encoding.expatName);
    reader.parse(source);

For that I need to import org.apache.harmony.xml.ExpatReader but I cannot figure out how, I mean which Java package must I install from http://harmon开发者_StackOverflow社区y.apache.org/download.cgi?

Or is there an alternative method to accomplish the same goal?

Thank you for helping.


you don't instantiate an expat reader directly. just use the XMLReaderFactory.

0

精彩评论

暂无评论...
验证码 换一张
取 消