Module bz2 :: Class BZ2Compressor
[hide private]
[frames] | no frames]

type BZ2Compressor

object --+
         |
        BZ2Compressor

BZ2Compressor([compresslevel=9]) -> compressor object

Create a new compressor object. This object may be used to compress data sequentially. If you want to compress data in one shot, use the compress() function instead. The compresslevel parameter, if given, must be a number between 1 and 9.

Instance Methods [hide private]
 
__delattr__(...)
x.__delattr__('name') <==> del x.name
 
__getattribute__(...)
x.__getattribute__('name') <==> x.name
compressor object
__init__(compresslevel=9)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
string
compress(data)
Provide more data to the compressor object.
string
flush()
Finish the compression process and return what is left in internal buffers.
Method Details [hide private]

__delattr__(...)

 

x.__delattr__('name') <==> del x.name

Overrides: object.__delattr__

__getattribute__(...)

 

x.__getattribute__('name') <==> x.name

Overrides: object.__getattribute__

__init__(compresslevel=9)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns: compressor object
Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__setattr__(...)

 

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__

compress(data)

 

Provide more data to the compressor object. It will return chunks of compressed data whenever possible. When you've finished providing data to compress, call the flush() method to finish the compression process, and return what is left in the internal buffers.

Returns: string

flush()

 

Finish the compression process and return what is left in internal buffers. You must not use the compressor object after calling this method.

Returns: string