-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Environment
jruby 9.1.10.0 (2.3.3) 2017-05-25 b09c48a Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 +jit [darwin-x86_64]
Expected Behavior
Zlib::GzipReader supports pushing data back onto the buffer via #ungetc and #ungetbyte.
# frozen_string_literal: true
require "zlib"
io = StringIO.new
writer = Zlib::GzipWriter.new(io)
writer.write "foo bar baz"
writer.close
reader = Zlib::GzipReader.new(StringIO.new(io.string))
reader.getc
reader.ungetc "b"
puts reader.read$ ruby -v
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
$ ruby gzip_reader_ungetc.rb
boo bar baz
$ ruby -r zlib -e "p Zlib::GzipReader.public_method_defined?(:ungetbyte)"
trueActual Behavior
Zlib::GzipReader implements #ungetc as a no-op and does not respond to #ungetbyte.
$ ruby -v
jruby 9.1.10.0 (2.3.3) 2017-05-25 b09c48a Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 +jit [darwin-x86_64]
$ ruby gzip_reader_ungetc.rb
oo bar baz
$ ruby -r zlib -e "p Zlib::GzipReader.public_method_defined?(:ungetbyte)"
falseReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels