Android: can not import org.apache.harmony.xml.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.
精彩评论