OwlCyberSecurity - MANAGER
Edit File: _compression.cpython-310.opt-1.pyc
o ����S�g1����������������������@���sB���d�Z�ddlZddlZejZG�dd��dej�ZG�dd��dej�ZdS�)z7Internal classes used by the gzip, lzma and bz2 modules�����Nc�������������������@���s0���e�Zd�ZdZdd��Zdd��Zdd��Zdd ��Zd S�)� BaseStreamzMode-checking helper functions.c�����������������C���s���|�j�rtd��d�S�)NzI/O operation on closed file)�closed� ValueError��self��r����3/opt/alt/python310/lib64/python3.10/_compression.py�_check_not_closed���s����zBaseStream._check_not_closedc�����������������C�������|�����s t�d��d�S�)NzFile not open for reading)�readable�io�UnsupportedOperationr���r���r���r����_check_can_read������� �zBaseStream._check_can_readc�����������������C���r ���)NzFile not open for writing)�writabler���r ���r���r���r���r����_check_can_write���r���zBaseStream._check_can_writec�����������������C���s(���|�����s t�d��|����st�d��d�S�)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r���r���r ����seekabler���r���r���r����_check_can_seek���s ��� �zBaseStream._check_can_seekN)�__name__� __module__�__qualname__�__doc__r ���r���r���r���r���r���r���r���r��� ���s����r���c�����������������������sr���e�Zd�ZdZdd��Zddd�Z��fdd�Zd d ��Zdd��Zddd�Z dd��Z dd��Zej fdd�Zdd��Z���ZS�)�DecompressReaderz5Adapts the decompressor API to a RawIOBase reader APIc�����������������C���s���dS�)NTr���r���r���r���r���r���$���s���zDecompressReader.readabler���c�����������������K���sB���||�_�d|�_d|�_d|�_||�_||�_|�jdi�|�j��|�_||�_d�S�)NFr������r���)�_fp�_eof�_pos�_size�_decomp_factory�_decomp_args� _decompressor�_trailing_error)r����fpZdecomp_factoryZtrailing_errorZdecomp_argsr���r���r����__init__'���s��� zDecompressReader.__init__c��������������������s���d�|�_�t�����S��N)r ����super�closer����� __class__r���r���r&���;���s��� zDecompressReader.closec�����������������C���s ���|�j����S�r$���)r���r���r���r���r���r���r���?���s��� zDecompressReader.seekablec�������������� ���C���s����t�|��9}|�d��}|��t|��}||d�t|��<�W�d�����n1�s$w���Y��W�d�����t|�S�W�d�����t|�S�1�s@w���Y��t|�S�)N�B)� memoryview�cast�read�len)r����bZviewZ byte_view�datar���r���r����readintoB���s���(���zDecompressReader.readintor���c�����������������C���s����|dk�r|�����S�|r |�jrdS�d�} �|�jjrA|�jjp|�j�t�}|s#n<|�jdi�|�j ��|�_z |�j� ||�}W�n$�|�jy@���Y�nw�|�jjrR|�j�t�}|sQt d��nd}|�j� ||�}|r^nq|sjd|�_|�j|�_dS�|��jt|�7��_|S�)Nr��������TzACompressed file ended before the end-of-stream marker was reachedr���)�readallr���r ����eofZunused_datar���r,����BUFFER_SIZEr���r���� decompressr!���Zneeds_input�EOFErrorr���r���r-���)r����sizer/���Zrawblockr���r���r���r,���H���sH��� �����zDecompressReader.readc�����������������C���s8���g�}|���tj��}r|�|��|���tj��}s d�|�S�)Nr1���)r,����sys�maxsize�append�join)r���Zchunksr/���r���r���r���r2���q���s ��� � zDecompressReader.readallc�����������������C���s0���|�j��d��d|�_d|�_|�jdi�|�j��|�_d�S�)Nr���Fr���)r����seekr���r���r���r���r ���r���r���r���r����_rewind|���s���zDecompressReader._rewindc�����������������C���s����|t�jkrn/|t�jkr|�j|�}n$|t�jkr.|�jdk�r(|��t�j�r( �|��t�j�s!|�j|�}ntd� |���||�jk�r?|�� ���n||�j8�}|dkra|��tt�j|��}|sW �|�jS�|t|�8�}|dksH|�jS�)Nr���zInvalid value for whence: {}) r����SEEK_SET�SEEK_CURr����SEEK_ENDr���r,����DEFAULT_BUFFER_SIZEr����formatr=����minr-���)r����offset�whencer/���r���r���r���r<�������s,��� � ��zDecompressReader.seekc�����������������C���s���|�j�S�)z!Return the current file position.)r���r���r���r���r����tell����s���zDecompressReader.tell)r���)r���)r���r���r���r���r���r#���r&���r���r0���r,���r2���r=���r���r>���r<���rF���� __classcell__r���r���r'���r���r���!���s���� )r���) r���r���r8���rA���r4����BufferedIOBaser���� RawIOBaser���r���r���r���r����<module>���s����