class Compress::Snappy::Writer
- Compress::Snappy::Writer
- IO
- Reference
- Object
Defined in:
Constructors
-
.new(io : IO, compression_ratio = Snappy::Consts::MIN_COMPRESSION_RATIO, sync_close = false)
Creates a new writer to the given io.
-
.new(filename : String)
Creates a new writer to the given filename.
Class Method Summary
-
.open(io : IO, sync_close = false, &)
Creates a new writer to the given io, yields it to the given block, and closes it at the end.
-
.open(filename : String, &)
Creates a new writer to the given filename, yields it to the given block, and closes it at the end.
Instance Method Summary
-
#close
Closes this writer.
-
#closed? : Bool
Returns
true
if this writer is closed. -
#flush
Compresses and write out any unbuffered data.
-
#read(slice : Bytes)
Always raises
IO::Error
because this is a write-onlyIO
. -
#sync_close=(sync_close)
Whether to close the enclosed
IO
when closing this writer. -
#sync_close? : Bool
Whether to close the enclosed
IO
when closing this writer. -
#write(slice : Bytes) : Nil
See
IO#write
.
Constructor Detail
Creates a new writer to the given io.
Class Method Detail
Creates a new writer to the given io, yields it to the given block, and closes it at the end.
Creates a new writer to the given filename, yields it to the given block, and closes it at the end.
Instance Method Detail
Compresses and write out any unbuffered data. This does nothing if there is no
currently buffered data.
See IO#flush
.