class

Compress::Snappy::Writer

Inherits IO / Reference / Object

Constructors

new(io : IO, compression_ratio : Float64 = Snappy::Consts::MIN_COMPRESSION_RATIO, sync_close : Bool = false)

Creates a new writer to the given io.

Source
new(filename : String)

Creates a new writer to the given filename.

Source

Class methods

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.

Source
open(filename : String, &)

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

Source

Instance methods

close

Closes this writer. Must be invoked after all data has been written.

Source
closed?

Returns true if this writer is closed.

Source
flush

Compresses and write out any unbuffered data. This does nothing if there is no currently buffered data. See IO#flush.

Source
read(slice : Bytes)

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

Source
sync_close=(sync_close : Bool)

Whether to close the enclosed IO when closing this writer.

Source
sync_close?

Whether to close the enclosed IO when closing this writer.

Source
write(slice : Bytes) : Nil

See IO#write.

Source