相关疑难解决方法(0)

iPhone上的压缩API

是否有可在iPhone上使用的压缩API?我们正在为我们的iPhone应用程序构建一些RESTful Web服务,但我们希望至少压缩一些对话以提高效率.

我不关心格式(ZIP,LHA,等等)是什么,并且它不需要是安全的.

一些受访者指出服务器可以压缩其输出,而iPhone可以消耗它.我们的情景正好相反.我们将压缩内容发布 Web服务.我们并不关心压缩的另一种方式.

compression iphone

30
推荐指数
3
解决办法
4万
查看次数

这是gzip inflate方法中的错误吗?

在搜索如何在iOS上膨胀gzip压缩数据时,会在结果数量中显示以下方法:

- (NSData *)gzipInflate
{
    if ([self length] == 0) return self;

    unsigned full_length = [self length];
    unsigned half_length = [self length] / 2;

    NSMutableData *decompressed = [NSMutableData dataWithLength: full_length + half_length];
    BOOL done = NO;
    int status;

    z_stream strm;
    strm.next_in = (Bytef *)[self bytes];
    strm.avail_in = [self length];
    strm.total_out = 0;
    strm.zalloc = Z_NULL;
    strm.zfree = Z_NULL;

    if (inflateInit2(&strm, (15+32)) != Z_OK) return nil;
    while (!done)
    {
        // Make sure we have enough room and reset the lengths.
        if …
Run Code Online (Sandbox Code Playgroud)

python compression gzip inflate ios

7
推荐指数
1
解决办法
2614
查看次数

标签 统计

compression ×2

gzip ×1

inflate ×1

ios ×1

iphone ×1

python ×1