a
    ze                     @   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 )zPython '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   s   t | t| fS N)zlibcompressleninputerrors r
   */usr/lib/python3.9/encodings/zlib_codec.pyzlib_encode   s    r   c                 C   s   t | t| fS r   )r   
decompressr   r   r
   r
   r   zlib_decode   s    r   c                   @   s    e Zd ZdddZdddZdS )	Codecr   c                 C   s
   t ||S r   )r   selfr   r	   r
   r
   r   encode   s    zCodec.encodec                 C   s
   t ||S r   )r   r   r
   r
   r   decode   s    zCodec.decodeN)r   )r   )__name__
__module____qualname__r   r   r
   r
   r
   r   r      s   
r   c                   @   s(   e Zd Zd
ddZdddZdd Zd	S )IncrementalEncoderr   c                 C   s   || _ t | _d S r   )r	   r   compressobjr   r	   r
   r
   r   __init__   s    zIncrementalEncoder.__init__Fc                 C   s.   |r| j |}|| j   S | j |S d S r   )r   r   flushr   r   finalcr
   r
   r   r   !   s    zIncrementalEncoder.encodec                 C   s   t  | _d S r   )r   r   r   r
   r
   r   reset(   s    zIncrementalEncoder.resetN)r   )F)r   r   r   r   r   r    r
   r
   r
   r   r      s   

r   c                   @   s(   e Zd Zd
ddZdddZdd Zd	S )IncrementalDecoderr   c                 C   s   || _ t | _d S r   )r	   r   decompressobjr   r
   r
   r   r   ,   s    zIncrementalDecoder.__init__Fc                 C   s.   |r| j |}|| j   S | j |S d S r   )r"   r   r   r   r
   r
   r   r   1   s    zIncrementalDecoder.decodec                 C   s   t  | _d S r   )r   r"   r   r
   r
   r   r    8   s    zIncrementalDecoder.resetN)r   )F)r   r   r   r   r   r    r
   r
   r
   r   r!   +   s   

r!   c                   @   s   e Zd ZeZdS )StreamWriterNr   r   r   bytescharbuffertyper
   r
   r
   r   r#   ;   s   r#   c                   @   s   e Zd ZeZdS )StreamReaderNr$   r
   r
   r
   r   r'   >   s   r'   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   r!   r'   r#   r
   r
   r
   r   getregentryC   s    r0   )r   )r   )__doc__r.   r   r   r   r   r   r!   r#   r'   r0   r
   r
   r
   r   <module>   s   

