Skip to content

class Compress::Zlib::Reader
inherits IO

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.

Included modules

IO::Buffered

Class methods

.open(io : IO, sync_close = false, dict : Bytes? = nil

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

View source

.new(io : IO, sync_close = false, dict : Bytes? = nil)

Creates a new reader from the given io.

View source

Methods

#closed? : Bool

Returns true if this reader is closed.

View source

#sync_close=(sync_close)

Whether to close the enclosed IO when closing this reader.

View source

#sync_close? : Bool

Whether to close the enclosed IO when closing this reader.

View source

#unbuffered_close

Closes the wrapped IO.

View source

#unbuffered_flush

Flushes the wrapped IO.

View source

#unbuffered_read(slice : Bytes)

See IO#read.

View source

#unbuffered_rewind

Rewinds the wrapped IO.

View source

#unbuffered_write(slice : Bytes)

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

View source