Inflate and deflate a string : zip « Development « Ruby






Inflate and deflate a string


require 'zlib'

deflated = Zlib::Deflate.deflate("this is a test.")
puts deflated
puts Zlib::Inflate.inflate(deflated)

 








Related examples in the same category

1.Compressing and Archiving Files with Gzip and Tar
2.Append to a zip file