lz4-objc is an Objective-C
category that provides lz4 compression and decompression algorithms.
lz4-objc library is provided as open-source software using MIT license.
- Copy the lz4 directory to your project and add the
lz4.c
andlz4hc.c
file to your target - Copy the lz4-objc directory to your project and add the
NSData+lz4.m
file to your target
NSData *data = // some data
NSData *compressed1 = [data compressLZ4:LZ4CompressionFast]; // use LZ4_compress_default
NSData *compressed2 = [data compressLZ4:LZ4CompressionHigh]; // use LZ4_compress_HC with LZ4HC_CLEVEL_DEFAULT
NSData *compressed3 = [data compressLZ4:LZ4CompressionHighOptMin]; // use LZ4_compress_HC with LZ4HC_CLEVEL_OPT_MIN
NSData *compressed4 = [data compressLZ4:LZ4CompressionHighMax]; // use LZ4_compress_HC with LZ4HC_CLEVEL_MAX
NSData *compressed = // some compressed data
NSData *decompressed1 = [compressed decompressLZ4]; // use LZ4_decompress_safe with a predefined buffer size
NSData *decompressed2 = [compressed decompressLZ4:1024]; // use LZ4_decompress_safe with a provided buffer size
-
lz4-objc 1.0.0
- First release