U e5d@sdZddlZddlZdddZdddZGdd d ejZGd d d ejZGd d d ejZGdddeejZGdddeej Z ddZ 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). NstrictcCst|t|fSN)bz2compressleninputerrorsr +/usr/lib64/python3.8/encodings/bz2_codec.py bz2_encodesr cCst|t|fSr)r decompressrrr r r bz2_decodesrc@s eZdZdddZdddZdS) CodecrcCs t||Sr)r selfrr 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 ddZd ddZddZd S) IncrementalEncoderrcCs||_t|_dSr)r r BZ2Compressor compressobjrr r r r __init__szIncrementalEncoder.__init__FcCs.|r|j|}||jS|j|SdSr)rrflush)rrfinalcr r r r#s zIncrementalEncoder.encodecCst|_dSr)rrrrr r r reset*szIncrementalEncoder.resetN)r)F)rrrrrr r r r r rs  rc@s(eZdZd ddZd ddZddZd S) IncrementalDecoderrcCs||_t|_dSr)r rBZ2Decompressor decompressobjrr r r r.szIncrementalDecoder.__init__FcCs*z|j|WStk r$YdSXdS)N)r#r EOFError)rrrr r r r3szIncrementalDecoder.decodecCst|_dSr)rr"r#rr r r r 9szIncrementalDecoder.resetN)r)F)rrrrrr r r r r r!-s  r!c@seZdZeZdS) StreamWriterNrrrbytescharbuffertyper r r r r&<sr&c@seZdZeZdS) StreamReaderNr'r r r r r*?sr*c CstjdttttttddS)NrF)namerrincrementalencoderincrementaldecoder streamwriter streamreader_is_text_encoding)codecs CodecInfor rrr!r&r*r r r r getregentryDsr3)r)r) __doc__r1rr rrrr!r&r*r3r r r r s