Back to index

python3.2  3.2.2
Classes | Functions
encodings.bz2_codec Namespace Reference

Classes

class  Codec
class  IncrementalEncoder
class  IncrementalDecoder
class  StreamWriter
class  StreamReader

Functions

def bz2_encode
 Codec APIs.
def bz2_decode
def getregentry

Detailed Description

Python 'bz2_codec' Codec - bz2 compression encoding.

This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().

Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).

Function Documentation

def encodings.bz2_codec.bz2_decode (   input,
  errors = 'strict' 
)

Definition at line 19 of file bz2_codec.py.

00019 
00020 def bz2_decode(input, errors='strict'):
00021     assert errors == 'strict'
00022     return (bz2.decompress(input), len(input))

Here is the caller graph for this function:

def encodings.bz2_codec.bz2_encode (   input,
  errors = 'strict' 
)

Codec APIs.

Definition at line 15 of file bz2_codec.py.

00015 
00016 def bz2_encode(input, errors='strict'):
00017     assert errors == 'strict'
00018     return (bz2.compress(input), len(input))

Here is the caller graph for this function:

Definition at line 68 of file bz2_codec.py.

00068 
00069 def getregentry():
00070     return codecs.CodecInfo(
00071         name="bz2",
00072         encode=bz2_encode,
00073         decode=bz2_decode,
00074         incrementalencoder=IncrementalEncoder,
00075         incrementaldecoder=IncrementalDecoder,
00076         streamwriter=StreamWriter,
00077         streamreader=StreamReader,
00078     )