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

The class for compressing data

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

allocate a new BZ2::Writer

new(object = nil, mode = "w", blocks = 9, work = 0)

Create a new BZ2::Writer associated with object.

object must respond to write, or must be nil in this case the compressed string is returned when flush is called

See initialize for blocks and work

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

Call Kernel#open(filename), associate it a new BZ2::Writer and call the associated block if given.

The bz2 object is closed at the end of the block

See initialize for blocks and work

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.

close!()

Terminate the compression and close the associated object

finish()

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

flush()

same than finish

<<(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

to_io()

return the associated object

write(str)

Write the string str