î ±+eÉã@sÏdZddlZddlZddd„Zddd„ZGdd „d ejƒZGd d „d ejƒ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/python34/lib64/python3.4/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__Fc Cs1y|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 Ús