U AT^c@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). iNstrictcCt|t|fSN)bz2compressleninputerrorsr +/usr/lib64/python3.8/encodings/bz2_codec.py bz2_encoder cCrr)r decompressrrr r r bz2_decoder rc@s eZdZdddZdddZdS) CodecrcC t||Sr)r selfrrr r r encodez Codec.encodecCrr)rrr r r decoderz Codec.decodeNrr)__name__ __module__ __qualname__rrr r r r rs rc@(eZdZd ddZd ddZddZd S) IncrementalEncoderrcC||_t|_dSr)rr BZ2Compressor compressobjrrr r r __init__zIncrementalEncoder.__init__FcCs.|r|j|}||jS|j|SdSr)rrZflush)rrfinalZcr r r r#s zIncrementalEncoder.encodecCt|_dSr)rrrrr r r reset*rzIncrementalEncoder.resetNrF)rrrr rr%r r r r rs  rc@r) IncrementalDecoderrcCrr)rrBZ2Decompressor decompressobjrr r r r .r!zIncrementalDecoder.__init__FcCs*z|j|WStk r$YdSXdS)NZ)r)r ZEOFError)rrr"r r r r3szIncrementalDecoder.decodecCr#r)rr(r)r$r r r r%9rzIncrementalDecoder.resetNrr&)rrrr rr%r r r r r'-s  r'c@eZdZeZdS) StreamWriterNrrrZbytesZcharbuffertyper r r r r+<r+c@r*) StreamReaderNr,r r r r r.?r-r.c CstjdttttttddS)NrF)ZnamerrZincrementalencoderZincrementaldecoderZ streamwriterZ streamreaderZ_is_text_encoding)codecsZ CodecInfor rrr'r+r.r r r r getregentryDsr0rr) Z__doc__r/rr rrrr'r+r.r0r r r r Zs