我可以知道如何随机访问 zip 文件并解压缩 ZipEntry 吗?
基本上我已经知道我希望从 zip 文件中获取的文件并且不想解压缩它。
这是将 zip 条目作为流获取的示例 (ZipFile.getInputStream(entry));
ZipEntry entry = zipFile.getEntry(entryName);
InputStream xmlInStream = zipFile.getInputStream(entry);
//process the stream- below one is for xml parsing.
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
return documentBuilder.parse(xmlInStream);