How to unzip a gzip file and write it to an uncompressed file on iPhone

I have a file, bigfile.gz, in the bundle of my iPhone application. When starting the application, I want to run this file in the "My Documents" folder in my application. How can I achieve this programmatically?

Basically, I need an effect: gunzip bigfile.gz .. Obviously, gunzip not available in iOS.

+6
source share
1 answer

As indicated in this post:

IPhone Compression API

both zlib and bzip2 are available. However, as another answer indicates, if you store data for conversations in an NSData object, then you can use the NSData category, which adds gzip and zlib compression / decompression as simple methods. Here is a useful link for this.

+4
source

Source: https://habr.com/ru/post/893024/


All Articles