Ruby 直接对内存中的字符串进行压缩和解压 2015/02/12 14003 require 'zlib' deflated = Zlib::Deflate.deflate("this is a test.") puts deflated puts Zlib::Inflate.inflate(deflated)