Class BZ2::Writer
In: bz2.rb
Parent: Object

The class for compressing data

Methods
<<    allocate    close    flush    new    open    print    printf    putc    puts    write   
Public Class methods
allocate()

allocate a new BZ2::Writer

open(file, mode = "w", blocks = 9, work = 0) {|bz2| ...}

Create a new BZ2::Writer and call the associated block. The object is closed at the end of the block

new(object = nil, blocks = 9, work = 0)

If object is nil then the compression will be made in a String which is returned when close or flush is called

Otherwise object must respond to write(str)

blocks specifies the block size to be used for compression. It should be a value between 1 and 9 inclusive, and the actual block size used is 100000 x this value

work controls how the compression phase behaves when presented with worst case, highly repetitive, input data.Allowable values range from 0 to 250 inclusive

Public Instance methods
close()

Terminate the compression.

flush()

Flush the data and terminate the compression, the object can be re-used to store another compressed string

<<(object)

Writes object. object will be converted to a string using to_s

print(object = $_, ...)

Writes the given object(s)

printf(format, object = $_, ...)

Formats and writes the given object(s)

putc(char)

Writes the given character

puts(object, ...)

Writes the given objects

write(str)

Write the string str