解压 NSData,不带临时文件

发布于 2024-08-10 16:44:17 字数 301 浏览 3 评论 0原文

我找到了几个库(LiteZipZipArchive),允许在 iPhone 上解压缩文件。但它们都需要以文件形式输入。是否有一个库允许直接解压缩包含 zip 存档数据的 NSData,而不将其写入临时文件?
我尝试采用上面提到的库来实现这一点,但到目前为止还没有成功。

I've found a couple of libs (LiteZip and ZipArchive) that allow to unzip files on iPhone. But both of them require an input as a file. Is there a library that allows to directly unzip NSData containing zip-archived data without writing it to temporary file?

I've tried to adopt mentioned above libs for that, but with no success so far.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

時窥 2024-08-17 16:44:17

这个答案这个问题,我指出CocoaDev wiki NSData 上的类别 为该类添加了 zip/unzip 支持。这会让你完全在记忆中完成这件事。

In this answer to this question, I point out the CocoaDev wiki category on NSData which adds zip / unzip support to that class. This would let you do this entirely in memory.

我还不会笑 2024-08-17 16:44:17

据我了解,zip格式单独存储文件,每个存储的文件都使用压缩算法进行压缩(通常是DEFLATE算法)。

如果您只对解压缩使用 DEFLATE 算法压缩的数据感兴趣,则可以使用此 zlib 添加到 NSData 来自 Mac 版 Google 工具箱
它不需要临时文件。

From what I understand, the zip format stores files separately and each stored file is compressed using a compression algorithm (generally it's the DEFLATE algorithm).

If you're only interested in uncompressing data that was compressed using the DEFLATE algorithm you could use this zlib addition to NSData from Google Toolbox For Mac
It doesn't need temporary files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文