Android:无法导入 org.apache.harmony.xml.ExpatReader
我需要解析 UTF-8 编码的输入流,所以我认为最合适的方法是使用
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 但我不知道如何,我的意思是我必须从 http://harmony.apache.org/download.cgi< 安装哪个 Java 包/a>?
或者是否有其他方法可以实现相同的目标?
谢谢你的帮助。
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://harmony.apache.org/download.cgi?
Or is there an alternative method to accomplish the same goal?
Thank you for helping.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不直接实例化外籍读者。只需使用 XMLReaderFactory 即可。
you don't instantiate an expat reader directly. just use the XMLReaderFactory.