我真的很惊讶我在谷歌上找不到这个问题的答案。特别是由于 xml 文件非常冗长,因此适合对其进行压缩。
我正在 VB6 程序中实现 msxml 库中的 sax 读取器,以从 zip 文件中读取大型的多 GB xml 文件。将这些文件解压缩到硬盘然后读取它们并不是正确的方法,因为解压缩到磁盘是不必要的,而且速度很慢。这就是我的问题所在。
我可以使用 zlib 从 zip 文件中读取数据块并处理这些数据块,但我在 SAXXMLReader 中没有看到任何处理数据块的方法。我已经读到 parse 方法接受 IStream,但我无法找到任何使用 Google 从 zip 文件获取 IStream 的方法。
这里的任何人都可以为我提供这个问题的答案或指向正确方向的指针吗?非常感谢您抽出时间。
I'm really kind of surprised I couldn't find an answer to this on Google. Especially since xml files lend themselves to being zipped since they are so verbose.
I'm implementing the sax reader from the msxml library in my VB6 program to read large multi-gigabyte xml files from a zip file. Unzipping these files to the hard drive and then reading them is not the way to go since unzipping to disk is not necessary and so slow. This is where my problem comes in.
I can use zlib to read chunks of data from the zip file and process those chunks, but I don't see any way in the SAXXMLReader to process chunks. I've read that the parse method accepts IStream, but I haven't been able to find any method using Google to get an IStream from a zip file.
Can anyone here please provide me an answer to this problem or a pointer in the right direction? Thank you so much for your time.
发布评论
评论(1)
从 zip 文件获取流的想法当然是我在 Java 中处理这个问题的方式。
我不是 .Net 开发人员,所以我很难证明这一点,但它看起来有点像 SharpZipLib 可能有您正在寻找的内容。
The idea of getting a stream from the zip file is certainly how I'd deal with this in Java.
I'm not a .Net developer, so it's hard for me to certify this, but it sort of looks like SharpZipLib may have what you're looking for.