This is an ObjC library for gzipping/ungzipping that directly manipulates files. It isn't implemented as a category on NSData
(unlike GZIP or Godzippa) so the full file doesn't have to be first loaded into memory.
Version 1.1.1 is the latest supporting iOS 7.
[[[NVHGzipFile alloc]
initWithPath:gzipFilePath]
inflateToPath:destinationFilePath completion:^(NSError *error) {
[self completeActionWithError:error];
}];
[[[NVHGzipFile alloc]
initWithPath:sourceFilePath]
deflateFromPath:destinationGzipFilePath completion:^(NSError *error) {
[self completeActionWithError:error];
}];
NSError *error = nil;
BOOL success = [[[NVHGzipFile alloc]
initWithPath:gzipFilePath]
inflateToPath:destinationFilePath error:&error];
NSError *error = nil;
BOOL success = [[[NVHGzipFile alloc]
initWithPath:sourceFilePath]
deflateFromPath:destinationGzipFilePath error:&error];
NVHGzipFile is available through CocoaPods, to install
it simply add the following line to your Podfile
:
pod "NVHGzipFile", :git => 'https://github.com/ReDetection/NVHGzipFile.git'
Niels van Hoorn, nvh@nvh.io
ReDetection just cutted out everyithing except gzip
Pull requests are welcome!
NVHGzipFile is available under the MIT license. See the LICENSE
file for more info.