class Compress::Deflate::Writer
inherits IO
¶
A write-only IO
object to compress data in the DEFLATE format.
Instances of this class wrap another IO object. When you write to this instance, it compresses the data and writes it to the underlying IO.
Note
unless created with a block, close
must be invoked after all
data has been written to a Flate::Writer instance.
Class methods¶
.open(io : IO, level : Int32 = Compress::Deflate::DEFAULT_COMPRESSION, strategy : Compress::Deflate::Strategy = Compress::Deflate::Strategy::DEFAULT, sync_close : Bool = false, dict : Bytes? = nil
¶
(io : IO, level : Int32 = Compress::Deflate::DEFAULT_COMPRESSION, strategy : Compress::Deflate::Strategy = Compress::Deflate::Strategy::DEFAULT, sync_close : Bool = false, dict : Bytes? = nil
Creates a new writer for the given io, yields it to the given block, and closes it at its end.
.new(output : IO, level : Int32 = Compress::Deflate::DEFAULT_COMPRESSION, strategy : Compress::Deflate::Strategy = Compress::Deflate::Strategy::DEFAULT, sync_close : Bool = false, dict : Bytes? = nil)
¶
(output : IO, level : Int32 = Compress::Deflate::DEFAULT_COMPRESSION, strategy : Compress::Deflate::Strategy = Compress::Deflate::Strategy::DEFAULT, sync_close : Bool = false, dict : Bytes? = nil)
Creates an instance of Flate::Writer. close
must be invoked after all data
has written.
Methods¶
#sync_close=(sync_close : Bool)
¶
(sync_close : Bool)
If #sync_close?
is true
, closing this IO will close the underlying IO.
#sync_close? : Bool
¶
: Bool
If #sync_close?
is true
, closing this IO will close the underlying IO.