class

Compress::Deflate::Reader

Inherits IO::Buffered / IO / Reference / Object

A read-only IO object to decompress data in the DEFLATE 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

gzip(input, sync_close : Bool = false) : self

Creates an instance of Flate::Reader for the gzip format. has written.

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

Creates an instance of Flate::Reader.

Source

Class methods

gzip(input, sync_close : Bool = false, &)

Creates an instance of Flate::Reader for the gzip format, yields it to the given block, and closes it at its end.

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

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

Source

Instance methods

closed?

Returns true if this reader is closed.

Source
dict

Dictionary passed in the constructor

Source
inspect(io : IO) : Nil

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
Source
sync_close=(sync_close : Bool)

If #sync_close? is true, closing this IO will close the underlying IO.

Source
sync_close?

If #sync_close? is true, closing this IO will close the underlying IO.

Source
unbuffered_close

Closes this reader.

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