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ÚstrictcCs|dks t‚tj|ƒt|ƒfS)Nr)ÚAssertionErrorÚbz2ÚcompressÚlen)ÚinputÚerrors©r ú+/usr/lib64/python3.6/encodings/bz2_codec.pyÚ bz2_encodes r cCs|dks t‚tj|ƒt|ƒfS)Nr)rrÚ decompressr)rrr r r Ú bz2_decodes r c@s eZdZddd„Zddd„ZdS) ÚCodecrcCs t||ƒS)N)r )Úselfrrr r r Úencodesz Codec.encodecCs t||ƒS)N)r )rrrr r r Údecodesz Codec.decodeN)r)r)Ú__name__Ú __module__Ú __qualname__rrr r r r rs rc@s(eZdZd dd„Zd dd„Zdd„Zd S) ÚIncrementalEncoderrcCs |dks t‚||_tjƒ|_dS)Nr)rrrÚ BZ2CompressorÚ compressobj)rrr r r Ú__init__s zIncrementalEncoder.__init__FcCs.|r|jj|ƒ}||jjƒS|jj|ƒSdS)N)rrÚflush)rrÚfinalÚcr r r r#s zIncrementalEncoder.encodecCstjƒ|_dS)N)rrr)rr r r Úreset*szIncrementalEncoder.resetN)r)F)rrrrrrr r r r rs  rc@s(eZdZd dd„Zd dd„Zdd„Zd S) ÚIncrementalDecoderrcCs |dks t‚||_tjƒ|_dS)Nr)rrrÚBZ2DecompressorÚ decompressobj)rrr r r r.s zIncrementalDecoder.__init__Fc Cs&y |jj|ƒStk r dSXdS)NÚ)rr ÚEOFError)rrrr r r r3s zIncrementalDecoder.decodecCstjƒ|_dS)N)rrr)rr r r r9szIncrementalDecoder.resetN)r)F)rrrrrrr r r r r-s  rc@seZdZeZdS)Ú StreamWriterN)rrrÚbytesÚcharbuffertyper r r r r"<sr"c@seZdZeZdS)Ú StreamReaderN)rrrr#r$r r r r r%?sr%c Cstjdttttttdd�S)NrF)ÚnamerrÚincrementalencoderÚincrementaldecoderÚ streamwriterÚ streamreaderÚ_is_text_encoding)ÚcodecsÚ CodecInfor r rrr"r%r r r r Ú getregentryDsr.)r)r) Ú__doc__r,rr r rrrr"r%r.r r r r Ús