U e5dÉã@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‚t |¡t|ƒfS©Nr)ÚAssertionErrorÚbz2ÚcompressÚlen©ÚinputÚerrors©r ú+/usr/lib64/python3.8/encodings/bz2_codec.pyÚ bz2_encodes r cCs|dks t‚t |¡t|ƒfSr)rrÚ decompressrrr r r Ú bz2_decodes rc@s eZdZddd„Zddd„ZdS) ÚCodecrcCs t||ƒS©N)r ©Úselfr r r r r Úencodesz Codec.encodecCs t||ƒSr)rrr 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‚||_t ¡|_dSr)rr rÚ BZ2CompressorÚ compressobj©rr r r r Ú__init__s zIncrementalEncoder.__init__FcCs.|r|j |¡}||j ¡S|j |¡SdSr)rrÚflush)rr ÚfinalÚcr r r r#s zIncrementalEncoder.encodecCst ¡|_dSr)rrr©rr r r Úreset*szIncrementalEncoder.resetN)r)F)rrrrrr"r r r r rs  rc@s(eZdZd dd„Zd dd„Zdd„Zd S) ÚIncrementalDecoderrcCs |dks t‚||_t ¡|_dSr)rr rÚBZ2DecompressorÚ decompressobjrr r r r.s zIncrementalDecoder.__init__FcCs*z|j |¡WStk r$YdSXdS)NÚ)r%rÚEOFError)rr rr r r r3szIncrementalDecoder.decodecCst ¡|_dSr)rr$r%r!r r r r"9szIncrementalDecoder.resetN)r)F)rrrrrr"r r r r r#-s  r#c@seZdZeZdS)Ú StreamWriterN©rrrÚbytesÚcharbuffertyper r r r r(<sr(c@seZdZeZdS)Ú StreamReaderNr)r r r r r,?sr,c Cstjdttttttdd�S)NrF)ÚnamerrÚincrementalencoderÚincrementaldecoderÚ streamwriterÚ streamreaderÚ_is_text_encoding)ÚcodecsÚ CodecInfor rrr#r(r,r r r r Ú getregentryDsør5)r)r) Ú__doc__r3rr rrrr#r(r,r5r r r r Ús