3 \@sdZddlZddlZdddZdddZGdd d ejZGd d d ejZGd d d ejZGdddeejZGdddeej Z ddZ dS)zPython 'zlib_codec' Codec - zlib compression encoding. This codec de/encodes from bytes to bytes. Written by Marc-Andre Lemburg (mal@lemburg.com). NstrictcCs|dks ttj|t|fS)Nr)AssertionErrorzlibcompresslen)inputerrorsr "/usr/lib64/python3.6/zlib_codec.py zlib_encode s r cCs|dks ttj|t|fS)Nr)rr decompressr)rrr r r zlib_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 ddZd ddZddZd S) IncrementalEncoderrcCs |dks t||_tj|_dS)Nr)rrr compressobj)rrr r r __init__s zIncrementalEncoder.__init__FcCs.|r|jj|}||jjS|jj|SdS)N)rrflush)rrfinalcr r r r!s zIncrementalEncoder.encodecCstj|_dS)N)rr)rr r r reset(szIncrementalEncoder.resetN)r)F)rrrrrrr r r r rs  rc@s(eZdZd ddZd ddZddZd S) IncrementalDecoderrcCs |dks t||_tj|_dS)Nr)rrr decompressobj)rrr r r r,s zIncrementalDecoder.__init__FcCs.|r|jj|}||jjS|jj|SdS)N)rr r)rrrrr r r r1s zIncrementalDecoder.decodecCstj|_dS)N)rr)rr r r r8szIncrementalDecoder.resetN)r)F)rrrrrrr r r r r+s  rc@seZdZeZdS) StreamWriterN)rrrbytescharbuffertyper r r r r;src@seZdZeZdS) StreamReaderN)rrrrr r r r r r!>sr!c CstjdttttttddS)NrF)namerrincrementalencoderincrementaldecoder streamreader streamwriter_is_text_encoding)codecs CodecInfor r rrr!rr r r r getregentryCsr*)r)r) __doc__r(rr r rrrrr!r*r r r r s