gdZddlZddlZddZddZGddej ZGddej ZGd d ejZGd d eejZGd deejZ dZ y)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). NcBtj|t|fSN)bz2compressleninputerrorss :/opt/alt/python312/lib64/python3.12/encodings/bz2_codec.py bz2_encoder s LL U ,,cBtj|t|fSr)r decompressrrs r bz2_decoders NN5 !3u: ..r ceZdZddZddZy)Codecct||Sr)r selfr r s r encodez Codec.encode%((r ct||Sr)rrs r decodez Codec.decoderr Nstrict)__name__ __module__ __qualname__rrr r rrs ))r rc"eZdZddZddZdZy)IncrementalEncodercD||_tj|_yr)r r BZ2Compressor compressobjrr s r __init__zIncrementalEncoder.__init__s ,,.r c|r8|jj|}||jjzS|jj|Sr)r$rflush)rr finalcs r rzIncrementalEncoder.encode#sL   ))%0At''--// /##,,U3 3r c6tj|_yr)rr#r$rs r resetzIncrementalEncoder.reset*s,,.r NrF)rrrr&rr-rr r r!r!s/ 4/r r!c"eZdZddZddZdZy)IncrementalDecodercD||_tj|_yr)r rBZ2Decompressor decompressobjr%s r r&zIncrementalDecoder.__init__.s  002r cX |jj|S#t$rYywxYw)N)r3rEOFError)rr r)s r rzIncrementalDecoder.decode3s0 %%007 7  s  ))c6tj|_yr)rr2r3r,s r r-zIncrementalDecoder.reset9s 002r Nrr.)rrrr&rr-rr r r0r0-s3  3r r0ceZdZeZy) StreamWriterNrrrbytescharbuffertyperr r r9r9<Nr r9ceZdZeZy) StreamReaderNr:rr r r?r??r=r r?c ltjdtttt t tdS)NrF)namerrincrementalencoderincrementaldecoder streamwriter streamreader_is_text_encoding)codecs CodecInfor rr!r0r9r?rr r getregentryrIDs-    --!!  r r) __doc__rGrr rrr!r0r9r?rIrr r rKs} -/)FLL) /22/ 322 35&--5&-- r