Skip to content
Godzippa! - GZip Compression / Decompression Category for NSData
Branch: master
Clone or download
Latest commit 97a8d36 Sep 20, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example
Godzippa.playground
Godzippa.xcodeproj
Godzippa.xcworkspace
Sources
Tests
Godzippa.podspec
LICENSE
README.md

README.md

Godzippa!

gzip Compression / Decompression Category for NSData & NSFileManager

Example Usage

NSData

NSData *originalData = [@"Look out! It's..." dataUsingEncoding:NSUTF8StringEncoding];
NSData *compressedData = [originalData dataByGZipCompressingWithError:nil];
NSData *decompressedData = [compressedData dataByGZipDecompressingDataWithError:nil];
NSLog(@"%@ %@", [NSString stringWithUTF8String:[decompressedData bytes]], @"Godzippa!");

NSFileManager

NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *file = [NSURL fileURLWithPath:@"/path/to/file.txt"];
NSError *error = nil;

[fileManager GZipCompressFile:file
        writingContentsToFile:[file URLByAppendingPathExtension:@"gz"]
                        error:&error];

Requirements

  • zlib - In the "Link Binary With Libraries" Build Phase of your Target, add libz.dylib

Contact

Mattt (@mattt)

License

Godzippa! is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.