DeflateSwift 0.0.7

DeflateSwift 0.0.7

TestsTested
LangLanguage SwiftSwift
License Custom
ReleasedLast Release Feb 2016
SPMSupports SPM

Maintained by Josh Baker.



DeflateSwift

Super simple interface for the deflate compression format in Swift. Two very easy to use classes, DeflateStream and InflateStream with only method write

Features

  • Pure Swift. No bridging with Objective-C
  • Simple Interface. Only two classes and one method required.
  • Advanced Options. Compression level a window bits.

Install (iOS and OS X)

Example

import DeflateSwift

var data : [UInt8] = [ /* some data here */ ]

// compress
var deflater = DeflateStream()
var (deflated, err) = deflater.write(data, flush: true)
if err != nil{
  fatalError("\(err!)")
}

// decompress
var inflater = InflateStream()
var (inflated, err) = inflater.write(deflated, flush: true)
if err != nil{
  fatalError("\(err!)")
}
println("success: \(inflated == data)")

Contact

Josh Baker @tidwall

License

The DeflateSwift source code available under the MIT License.