• File: bz2_codec.cpython-37.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/encodings/__pycache__/bz2_codec.cpython-37.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 3.21 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

Nj@sdZddlZddlZdddZdddZGdd	d	ejZGd
ddejZGd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).
NstrictcCs|dkstt|t|fS)Nr)AssertionErrorbz2compresslen)inputerrorsr	8/opt/alt/python37/lib64/python3.7/encodings/bz2_codec.py
bz2_encodesrcCs|dkstt|t|fS)Nr)rr
decompressr)rrr	r	r

bz2_decodesr
c@s eZdZdddZdddZdS)	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
ddZdddZddZd	S)IncrementalEncoderrcCs |dkst||_t|_dS)Nr)rrr
BZ2Compressorcompressobj)rrr	r	r
__init__szIncrementalEncoder.__init__FcCs.|r|j|}||jS|j|SdS)N)rrflush)rrfinalcr	r	r
r#szIncrementalEncoder.encodecCst|_dS)N)rrr)rr	r	r
reset*szIncrementalEncoder.resetN)r)F)rrrrrrr	r	r	r
rs

rc@s(eZdZd
ddZdddZddZd	S)IncrementalDecoderrcCs |dkst||_t|_dS)Nr)rrrBZ2Decompressor
decompressobj)rrr	r	r
r.szIncrementalDecoder.__init__FcCs&y|j|Stk
r dSXdS)N)rrEOFError)rrrr	r	r
r3szIncrementalDecoder.decodecCst|_dS)N)rrr)rr	r	r
r9szIncrementalDecoder.resetN)r)F)rrrrrrr	r	r	r
r-s

rc@seZdZeZdS)StreamWriterN)rrrbytescharbuffertyper	r	r	r
r"<sr"c@seZdZeZdS)StreamReaderN)rrrr#r$r	r	r	r
r%?sr%c
CstjdttttttddS)NrF)namerrincrementalencoderincrementaldecoderstreamwriterstreamreader_is_text_encoding)codecs	CodecInforr
rrr"r%r	r	r	r
getregentryDsr.)r)r)__doc__r,rrr
rrrr"r%r.r	r	r	r
<module>s