Viewing File: /opt/alt/python35/lib64/python3.5/encodings/__pycache__/bz2_codec.cpython-35.opt-1.pyc



¯ÕYfÉã@sÏdZddlZddlZddd„Zddd„ZGdd	„d	ejƒZGd
d„dejƒZGdd
„d
ejƒZGdd„deejƒZGdd„deej	ƒZ	dd„Z
dS)aPython '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).
éNÚstrictcCstj|ƒt|ƒfS)N)Úbz2ÚcompressÚlen)ÚinputÚerrors©rú8/opt/alt/python35/lib64/python3.5/encodings/bz2_codec.pyÚ
bz2_encodesr
cCstj|ƒt|ƒfS)N)rÚ
decompressr)rrrrr	Ú
bz2_decodesrc@s.eZdZddd„Zddd„ZdS)ÚCodecrcCs
t||ƒS)N)r
)Úselfrrrrr	ÚencodeszCodec.encodecCs
t||ƒS)N)r)rrrrrr	ÚdecodeszCodec.decodeN)Ú__name__Ú
__module__Ú__qualname__rrrrrr	r
sr
c@s:eZdZddd„Zddd„Zdd„Zd	S)
ÚIncrementalEncoderrcCs||_tjƒ|_dS)N)rrÚ
BZ2CompressorÚcompressobj)rrrrr	Ú__init__s	zIncrementalEncoder.__init__FcCs=|r)|jj|ƒ}||jjƒS|jj|ƒSdS)N)rrÚflush)rrÚfinalÚcrrr	r#szIncrementalEncoder.encodecCstjƒ|_dS)N)rrr)rrrr	Úreset*szIncrementalEncoder.resetN)rrrrrrrrrr	rsrc@s:eZdZddd„Zddd„Zdd„Zd	S)
ÚIncrementalDecoderrcCs||_tjƒ|_dS)N)rrÚBZ2DecompressorÚ
decompressobj)rrrrr	r.s	zIncrementalDecoder.__init__FcCs1y|jj|ƒSWntk
r,dSYnXdS)NÚ)rrÚEOFError)rrrrrr	r3s
zIncrementalDecoder.decodecCstjƒ|_dS)N)rrr)rrrr	r9szIncrementalDecoder.resetN)rrrrrrrrrr	r-src@seZdZeZdS)ÚStreamWriterN)rrrÚbytesÚcharbuffertyperrrr	r!<sr!c@seZdZeZdS)ÚStreamReaderN)rrrr"r#rrrr	r$?sr$cCs:tjdddtdtdtdtdtdtd	d
ƒS)NÚnamerrrÚincrementalencoderÚincrementaldecoderÚstreamwriterÚstreamreaderÚ_is_text_encodingF)ÚcodecsÚ	CodecInfor
rrrr!r$rrrr	ÚgetregentryDs	r-)Ú__doc__r+rr
rr
rrr!r$r-rrrr	Ú<module>s
Back to Directory File Manager