class Compress::Snappy::Reader
- Compress::Snappy::Reader
- IO
- Reference
- Object
Included Modules
- IO::Buffered
Defined in:
snappy/reader.crConstructors
-
.new(io : IO, verify_checksums : Bool = true, sync_close : Bool = false)
Creates a new reader from the given io.
-
.new(filename : String, verify_checksums = true)
Creates a new reader from the given filename.
Class Method Summary
-
.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.
-
.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.
Instance Method Summary
-
#closed? : Bool
Returns
true
if this reader is closed. - #reset(io)
-
#sync_close=(sync_close : Bool)
Whether to close the enclosed
IO
when closing this reader. -
#sync_close? : Bool
Whether to close the enclosed
IO
when closing this reader. -
#unbuffered_close
Closes this reader.
-
#unbuffered_flush
Flushes the wrapped
IO
. -
#unbuffered_read(slice : Bytes)
Reads at most slice.size bytes from the wrapped
IO
into slice. -
#unbuffered_rewind
Rewinds the wrapped
IO
. -
#unbuffered_write(slice : Bytes) : Nil
Always raises
IO::Error
because this is a read-onlyIO
.
Constructor Detail
Creates a new reader from the given io.
Creates a new reader from the given filename.
Class Method Detail
Creates a new reader from the given io, yields it to the given block, and closes it at the end.
Creates a new reader from the given filename, yields it to the given block, and closes it at the end.
Instance Method Detail
Reads at most slice.size bytes from the wrapped IO
into slice.
Returns the number of bytes read.