class Compress::Snappy::Writer

Defined in:

snappy/writer.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

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

Creates a new writer to the given io.


[View source]
def self.new(filename : String) #

Creates a new writer to the given filename.


[View source]

Class Method Detail

def self.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.


[View source]
def self.open(filename : String, &) #

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


[View source]

Instance Method Detail

def close #

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


[View source]
def closed? : Bool #

Returns true if this writer is closed.


[View source]
def flush #

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


[View source]
def read(slice : Bytes) #

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


[View source]
def sync_close=(sync_close : Bool) #

Whether to close the enclosed IO when closing this writer.


[View source]
def sync_close? : Bool #

Whether to close the enclosed IO when closing this writer.


[View source]
def write(slice : Bytes) : Nil #

See IO#write.


[View source]