Skip to content

An Objective-C category that provides lz4 compression and decompression algorithms

License

Notifications You must be signed in to change notification settings

fingltd/lz4-objc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lz4-objc

Build Status GitHub issues GitHub license

lz4-objc is an Objective-C category that provides lz4 compression and decompression algorithms.

License

lz4-objc library is provided as open-source software using MIT license.

Installation

  • Copy the lz4 directory to your project and add the lz4.c and lz4hc.c file to your target
  • Copy the lz4-objc directory to your project and add the NSData+lz4.m file to your target

Usage

Compression:

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

Decompression:

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

Releases and changelog

  • lz4-objc 1.0.0

    • First release

About

An Objective-C category that provides lz4 compression and decompression algorithms

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published