Skip to content
class method

Zlib::GzipWriter.new

(::_Writer io, ?::Integer? level, ?::Integer? strategy, **untyped opts) -> ::Zlib::GzipWriter
Zlib::GzipWriter.new(io, level = nil, strategy = nil, options = {})

Creates a GzipWriter object associated with io. level and strategy should be the same as the arguments of Zlib::Deflate.new. The GzipWriter object writes gzipped data to io. io must respond to the write method that behaves the same as IO#write.

The options hash may be used to set the encoding of the data. :external_encoding, :internal_encoding and :encoding may be set as in IO::new.

See also .open #<< also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0