NSData+gzip.m
author Jens Alfke <jens@mooseyard.com>
Wed Sep 02 08:41:25 2009 -0700 (2009-09-02)
changeset 35 5cab3034d3a1
permissions -rw-r--r--
10.6 compatibility: Fix some new compiler warnings, and work around apparent regressions in NSTask and -stringByStandardizingPath.
     1 //
     2 //  NSData+gzip.m
     3 //  Cloudy
     4 //
     5 //  Created by Jens Alfke on 6/27/09.
     6 //  Copyright 2009 Jens Alfke. All rights reserved.
     7 //
     8 
     9 #import "NSData+gzip.h"
    10 #import "GTMNSData+zlib.h"
    11 
    12 @implementation NSData (gzip)
    13 
    14 - (NSData*) my_gzippedWithCompression: (int)compression {
    15     return [NSData gtm_dataByGzippingBytes: self.bytes
    16                                     length: self.length
    17                           compressionLevel: compression];
    18 }
    19 
    20 - (NSData*) my_gunzipped {
    21     return [NSData gtm_dataByInflatingBytes: self.bytes length: self.length];
    22 }
    23 
    24 @end