Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JRuby 1.2
-
Component/s: Extensions
-
Labels:None
-
Number of attachments :
Description
Based on the script here: http://redmine.ruby-lang.org/issues/show/239
The output doesn't appear right because it seems like deflate.finish is just returning an empty string:
deflated: "" inflated: ""
Here's the contents of the script:
require 'zlib' data = ('a'..'z').to_a.join d = Zlib::Deflate.new Zlib::NO_COMPRESSION, Zlib::MAX_WBITS, Zlib::DEF_MEM_LEVEL, Zlib::DEFAULT_STRATEGY d << data.slice!(0, 10) d.params Zlib::BEST_COMPRESSION, Zlib::DEFAULT_STRATEGY d << data deflated = d.finish puts "deflated: %p" % deflated inflated = Zlib::Inflate.inflate deflated puts "inflated: %p" % inflatedIt appears that it's the modification of compression params in the middle causing problems. When that line is commented out, deflate works correctly.
require 'zlib' data = ('a'..'z').to_a.join d = Zlib::Deflate.new Zlib::NO_COMPRESSION, Zlib::MAX_WBITS, Zlib::DEF_MEM_LEVEL, Zlib::DEFAULT_STRATEGY d << data.slice!(0, 10) d.params Zlib::BEST_COMPRESSION, Zlib::DEFAULT_STRATEGY d << data deflated = d.finish puts "deflated: %p" % deflated inflated = Zlib::Inflate.inflate deflated puts "inflated: %p" % inflated