class

Compress::Zlib::Reader

Inherits IO::Buffered / IO / Reference / Object

A read-only IO object to decompress data in the zlib format.

Instances of this class wrap another IO object. When you read from this instance instance, it reads data from the underlying IO, decompresses it, and returns it to the caller.

Constructors

new(io : IO, sync_close : Bool = false, dict : Bytes | Nil = nil)

Creates a new reader from the given io.

Source

Class methods

open(io : IO, sync_close = false, dict : Bytes | Nil = nil, &)

Creates a new reader from the given io, yields it to the given block, and closes it at the end.

Source

Instance methods

closed?

Returns true if this reader is closed.

Source
sync_close=(sync_close : Bool)

Whether to close the enclosed IO when closing this reader.

Source
sync_close?

Whether to close the enclosed IO when closing this reader.

Source
unbuffered_close

Closes the wrapped IO.

TODO: Add return type restriction Nil

Source
unbuffered_flush

Flushes the wrapped IO.

TODO: Add return type restriction Nil

Source
unbuffered_read(slice : Bytes) : Int32

See IO#read.

Source
unbuffered_rewind

Rewinds the wrapped IO.

TODO: Add return type restriction Nil

Source
unbuffered_write(slice : Bytes) : NoReturn

Always raises IO::Error because this is a read-only IO.

Source