class Compress::Snappy::Writer

Defined in:

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

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

Creates a new writer to the given io.


def self.new(filename : String) #

Creates a new writer to the given filename.


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.


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.


Instance Method Detail

def close #

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


def closed? : Bool #

Returns true if this writer is closed.


def flush #

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


def read(slice : Bytes) #

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


def sync_close=(sync_close) #

Whether to close the enclosed IO when closing this writer.


def sync_close? : Bool #

Whether to close the enclosed IO when closing this writer.


def write(slice : Bytes) : Nil #

See IO#write.