grthtrhthjhtyjytjytkergtrhtrjytjerhrfh3 \Üã@s6ddlZejZGdd„dejƒZGdd„dejƒZdS)éNc@s,eZdZdd„Zdd„Zdd„Zdd„Zd S) Ú BaseStreamcCs|jrtdƒ‚dS)NzI/O operation on closed file)ÚclosedÚ ValueError)Úself©rú$/usr/lib64/python3.6/_compression.pyÚ_check_not_closed szBaseStream._check_not_closedcCs|jƒstjdƒ‚dS)NzFile not open for reading)ÚreadableÚioÚUnsupportedOperation)rrrrÚ_check_can_readszBaseStream._check_can_readcCs|jƒstjdƒ‚dS)NzFile not open for writing)Úwritabler r )rrrrÚ_check_can_writeszBaseStream._check_can_writecCs(|jƒstjdƒ‚|jƒs$tjdƒ‚dS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r r r Úseekable)rrrrÚ_check_can_seeks zBaseStream._check_can_seekN)Ú__name__Ú __module__Ú __qualname__rr rrrrrrr srcsheZdZdd„Zffdd„Z‡fdd„Zdd„Zd d „Zdd d „Zdd„Z e j fdd„Z dd„Z ‡ZS)ÚDecompressReadercCsdS)NTr)rrrrr $szDecompressReader.readablecKs>||_d|_d|_d|_||_||_|jf|jŽ|_||_dS)NFrééÿÿÿÿ)Ú_fpÚ_eofÚ_posÚ_sizeÚ_decomp_factoryÚ _decomp_argsÚ _decompressorÚ_trailing_error)rÚfpZdecomp_factoryZtrailing_errorZ decomp_argsrrrÚ__init__'szDecompressReader.__init__csd|_tƒjƒS)N)rÚsuperÚclose)r)Ú __class__rrr";szDecompressReader.closecCs |jjƒS)N)rr)rrrrr?szDecompressReader.seekablecCsPt|ƒ�:}|jdƒ�$}|jt|ƒƒ}||dt|ƒ…<WdQRXWdQRXt|ƒS)NÚB)Ú memoryviewÚcastÚreadÚlen)rÚbZviewZ byte_viewÚdatarrrÚreadintoBs$zDecompressReader.readintorc Csð|dkr|jƒS| s|jr dSd}xž|jjr†|jjp@|jjtƒ}|sHP|jf|j Ž|_y|jj ||ƒ}Wqº|j k r‚PYqºXn4|jj r¨|jjtƒ}|s¬t dƒ‚nd}|jj ||ƒ}|r&Pq&W|sÚd|_|j|_dS|jt|ƒ7_|S)NrózACompressed file ended before the end-of-stream marker was reachedT)ÚreadallrrÚeofZ unused_datarr'Ú BUFFER_SIZErrZ decompressrZ needs_inputÚEOFErrorrrr()rÚsizer*Zrawblockrrrr'Hs>      zDecompressReader.readcCs,|jjdƒd|_d|_|jf|jŽ|_dS)NrF)rÚseekrrrrr)rrrrÚ_rewindrs zDecompressReader._rewindcCs¸|tjkr nV|tjkr"|j|}n@|tjkrT|jdkrHx|jtjƒrFq8W|j|}ntdj |ƒƒ‚||jkrv|j ƒn ||j8}x0|dkr°|jt tj|ƒƒ}|s¢P|t |ƒ8}q‚W|jS)NrzInvalid value for whence: {}) r ÚSEEK_SETÚSEEK_CURrÚSEEK_ENDrr'ÚDEFAULT_BUFFER_SIZErÚformatr3Úminr()rÚoffsetÚwhencer*rrrr2xs&          zDecompressReader.seekcCs|jS)N)r)rrrrÚtell–szDecompressReader.tellr)r)rrrr r r"rr+r'r3r r4r2r<Ú __classcell__rr)r#rr!s   *r)r r7r/ÚBufferedIOBaserÚ RawIOBaserrrrrÚs