在iPhone上压缩API [英] Compression API on the iPhone

查看:139
本文介绍了在iPhone上压缩API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有可用于iPhone上的压缩API?我们正在为我们的iPhone应用程序构建一些RESTful Web服务,但我们至少要压缩一些对话以提高效率。

Is there a compression API available for use on the iPhone? We're building some RESTful web services for our iPhone app to talk to, but we want to compress at least some of the conversations for efficiency.

我不在乎

有些受访者指出,服务器可以压缩其输出,并且不需要安全。 iPhone可以消耗。我们的情况恰恰相反。我们将发送压缩内容网络服务。我们不关心压缩的方式。

Some respondents have pointed out that the server can compress its output, and the iPhone can consume that. The scenario we have is exactly the reverse. We'll be POSTing compressed content to the web service. We're not concerned with compression going the other way.

推荐答案

zlib和bzip2可用。您可以随时添加其他人,只要他们(通常)在OS X下编译。

zlib and bzip2 are available. And you can always add others, as long as they'll (generally) compile under OS X.

bzip2是最小文件大小的更好的选择,但需要更多CPU能够压缩和解压缩。

bzip2 is a better choice for smallest file sizes, but requires much more CPU power to compress and decompress.

此外,由于你正在与一个web服务交谈,你可能不需要做太多。 NSURLRequest 在服务器响应中透明地接受gzip编码

Also, since you're talking to a web service, you may not have to do much. NSURLRequest accepts gzip encoding transparently in server responses.

这篇关于在iPhone上压缩API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆