3 \Éã@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ú+/usr/lib64/python3.6/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)r)r)Ú__name__Ú __module__Ú __qualname__rrrrrr r s r c@s(eZdZd dd„Zd dd„Zdd„Zd S) ÚIncrementalEncoderrcCs||_tjƒ|_dS)N)rrÚ BZ2CompressorÚ compressobj)rrrrr Ú__init__szIncrementalEncoder.__init__FcCs.|r|jj|ƒ}||jjƒS|jj|ƒSdS)N)rrÚflush)rrÚfinalÚcrrr r#s zIncrementalEncoder.encodecCstjƒ|_dS)N)rrr)rrrr Úreset*szIncrementalEncoder.resetN)r)F)rrrrrrrrrr rs  rc@s(eZdZd dd„Zd dd„Zdd„Zd S) ÚIncrementalDecoderrcCs||_tjƒ|_dS)N)rrÚBZ2DecompressorÚ decompressobj)rrrrr r.szIncrementalDecoder.__init__Fc Cs&y |jj|ƒStk r dSXdS)NÚ)rr ÚEOFError)rrrrrr r3s zIncrementalDecoder.decodecCstjƒ|_dS)N)rrr)rrrr r9szIncrementalDecoder.resetN)r)F)rrrrrrrrrr r-s  rc@seZdZeZdS)Ú StreamWriterN)rrrÚbytesÚcharbuffertyperrrr r!<sr!c@seZdZeZdS)Ú StreamReaderN)rrrr"r#rrrr r$?sr$c Cstjdttttttdd�S)NrF)ÚnamerrÚincrementalencoderÚincrementaldecoderÚ streamwriterÚ streamreaderÚ_is_text_encoding)ÚcodecsÚ CodecInfor r rrr!r$rrrr Ú getregentryDsr-)r)r) Ú__doc__r+rr r r rrr!r$r-rrrr Ús