A write-only IO
object to compress data in the zlib 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 Zlib::Writer instance.
Creates a new writer to the given io.
Creates a new writer to the given filename.
Creates a new writer to the given io, yields it to the given block, and closes it at the end.
Creates a new writer to the given filename, yields it to the given block, and closes it at the end.
Closes this writer.
Returns true
if this writer is closed.
Flushes data, forcing writing the zlib header if no data has been written yet.
Whether to close the enclosed IO
when closing this writer.
Whether to close the enclosed IO
when closing this writer.
See IO#write
.
IO
IO
Reference
Reference
Object
Object
Creates a new writer to the given io.
Creates a new writer to the given filename.
Creates a new writer to the given io, yields it to the given block, and closes it at the end.
Creates a new writer to the given filename, yields it to the given block, and closes it at the end.
Closes this writer. Must be invoked after all data has been written.
Flushes data, forcing writing the zlib header if no data has been written yet.
See IO#flush
.
© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/Compress/Zlib/Writer.html