o
    éT•jœ  ã                   @   s’   d Z ddlZddlZddd„Zddd„ZG dd	„ d	ejƒZG d
d„ dejƒZG dd„ dejƒZG dd„ deejƒZG dd„ deej	ƒZ	dd„ Z
dS )z•Python 'zlib_codec' Codec - zlib compression encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com).
é    NÚstrictc                 C   ó   |dksJ ‚t  | ¡t| ƒfS ©Nr   )ÚzlibÚcompressÚlen©ÚinputÚerrors© r   ú+/usr/lib/python3.10/encodings/zlib_codec.pyÚzlib_encode   ó   r   c                 C   r   r   )r   Ú
decompressr   r   r   r   r   Úzlib_decode   r   r   c                   @   s    e Zd Zddd„Zddd„ZdS )ÚCodecr   c                 C   ó
   t ||ƒS ©N)r   ©Úselfr	   r
   r   r   r   Úencode   ó   
zCodec.encodec                 C   r   r   )r   r   r   r   r   Údecode   r   zCodec.decodeN©r   )Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r      s    
r   c                   @   ó(   e Zd Zd
dd„Zddd„Zdd„ Zd	S )ÚIncrementalEncoderr   c                 C   ó    |dksJ ‚|| _ t ¡ | _d S r   )r
   r   Úcompressobj©r   r
   r   r   r   Ú__init__   ó   zIncrementalEncoder.__init__Fc                 C   ó*   |r| j  |¡}|| j  ¡  S | j  |¡S r   )r    r   Úflush©r   r	   ÚfinalÚcr   r   r   r   !   ó   zIncrementalEncoder.encodec                 C   ó   t  ¡ | _d S r   )r   r    ©r   r   r   r   Úreset(   ó   zIncrementalEncoder.resetNr   ©F)r   r   r   r"   r   r,   r   r   r   r   r      ó    

r   c                   @   r   )ÚIncrementalDecoderr   c                 C   r   r   )r
   r   Údecompressobjr!   r   r   r   r"   ,   r#   zIncrementalDecoder.__init__Fc                 C   r$   r   )r1   r   r%   r&   r   r   r   r   1   r)   zIncrementalDecoder.decodec                 C   r*   r   )r   r1   r+   r   r   r   r,   8   r-   zIncrementalDecoder.resetNr   r.   )r   r   r   r"   r   r,   r   r   r   r   r0   +   r/   r0   c                   @   ó   e Zd ZeZdS )ÚStreamWriterN©r   r   r   ÚbytesÚcharbuffertyper   r   r   r   r3   ;   ó    r3   c                   @   r2   )ÚStreamReaderNr4   r   r   r   r   r8   >   r7   r8   c                
   C   s   t jdttttttdd�S )Nr   F)Únamer   r   ÚincrementalencoderÚincrementaldecoderÚstreamreaderÚstreamwriterÚ_is_text_encoding)ÚcodecsÚ	CodecInfor   r   r   r0   r8   r3   r   r   r   r   ÚgetregentryC   s   ørA   r   )Ú__doc__r?   r   r   r   r   r   r0   r3   r8   rA   r   r   r   r   Ú<module>   s    

