class

Compress::Snappy::Reader

Inherits IO::Buffered / IO / Reference / Object

Constructors

new(io : IO, verify_checksums : Bool = true, sync_close : Bool = false)

Creates a new reader from the given io.

Source
new(filename : String, verify_checksums = true)

Creates a new reader from the given filename.

Source

Class methods

open(io : IO, verify_checksums = true, sync_close = false, &)

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

Source
open(filename : String, verify_checksums = true, &)

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

Source

Instance methods

closed?

Returns true if this reader is closed.

Source
reset(io)
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 this reader.

Source
unbuffered_flush

Flushes the wrapped IO.

TODO: Add return type restriction Nil

Source
unbuffered_read(slice : Bytes)

Reads at most slice.size bytes from the wrapped IO into slice. Returns the number of bytes read.

TODO: Add return type restriction Int32

Source
unbuffered_rewind

Rewinds the wrapped IO.

TODO: Add return type restriction Nil

Source
unbuffered_write(slice : Bytes) : Nil

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

Source