Popularity
3.9
Growing
Activity
0.0
Stable
9
4
2

Programming language: Crystal
License: MIT License
Tags: Low Level Bindings    

zlib.cr alternatives and similar shards

Based on the "Low level bindings" category.
Alternatively, view zlib.cr alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of zlib.cr or a related project?

Add another 'Low level bindings' Shard

README

zlib.cr

This library provides binding for ZLib library.

Status

Alpha

Requirements

  • Crystal language version 0.9 and higher.
  • zlib version 1.2.5 or higher

Goal

Provide a simple API to handle Zlib Deflate/Inflate stream and GZFile API.

Usage

An example of using GZFile API:

Zlib::GZFile.open("output.gz", "w") do |f|
  f.puts "hello world!"
end

An example of deflating of a stream of data:

File.open("data.txt", "r") do |src|
  File.open("data.txt.z", "w") do |dst|
    deflate = Zlib::Deflate.new(dst)

    IO.copy(src, deflate)
    deflate.finish
  end
end

and inflating it back:

File.open("data.txt.z", "r") do |src|
  inflate = Zlib::Inflate.new(STDOUT)

  IO.copy(src, inflate)
end

License

MIT clause - see LICENSE for more details.


*Note that all licence references and agreements mentioned in the zlib.cr README section above are relevant to that project's source code only.