Viewing File: /opt/alt/python35/lib64/python3.5/__pycache__/_compression.cpython-35.opt-2.pyc



]@sKddlZejZGdddejZGdddejZdS)Nc@s@eZdZddZddZddZddZd	S)

BaseStreamcCs|jrtddS)NzI/O operation on closed file)closed
ValueError)selfr1/opt/alt/python35/lib64/python3.5/_compression.py_check_not_closeds	zBaseStream._check_not_closedcCs|jstjddS)NzFile not open for reading)readableioUnsupportedOperation)rrrr_check_can_readszBaseStream._check_can_readcCs|jstjddS)NzFile not open for writing)writabler
r)rrrr_check_can_writeszBaseStream._check_can_writecCs:|jstjd|js6tjddS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r	r
rseekable)rrrr_check_can_seekszBaseStream._check_can_seekN)__name__
__module____qualname__rrrrrrrrr	srcseZdZddZfddZfddZddZd	d
Zddd
ZddZ	e
jddZddZ
S)DecompressReadercCsdS)NTr)rrrrr	$szDecompressReader.readablecKsX||_d|_d|_d|_||_||_|j|j|_||_dS)NFr)_fp_eof_pos_size_decomp_factory_decomp_args
_decompressor_trailing_error)rfpdecomp_factorytrailing_errordecomp_argsrrr__init__'s						zDecompressReader.__init__csd|_tjS)N)rsuperclose)r)	__class__rrr%;s	zDecompressReader.closecCs
|jjS)N)rr)rrrrr?szDecompressReader.seekablecCsdt|K}|jd2}|jt|}||dt|<WdQRXWdQRXt|S)NB)
memoryviewcastreadlen)rbview	byte_viewdatarrrreadintoBs!$zDecompressReader.readintorcCs?|dkr|jS|s&|jr*dSd}x|jjr|jjpZ|jjt}|sdP|j|j	|_y|jj
||}Wq|jk
rPYqXnN|jjr|jjt}|st
dnd}|jj
||}|r3Pq3W|s&d|_|j|_dS|jt|7_|S)NrzACompressed file ended before the end-of-stream marker was reachedT)readallrreofunused_datarr*BUFFER_SIZErr
decompressrneeds_inputEOFErrorrrr+)rsizer/rawblockrrrr*Hs>
		zDecompressReader.readcCs;|jjdd|_d|_|j|j|_dS)NrF)rseekrrrrr)rrrr_rewindrs		zDecompressReader._rewindcCs|tjkrn{|tjkr1|j|}n\|tjkrx|jdkrhx|jtjrgqRW|j|}ntdj	|||jkr|j
n
||j8}xB|dkr|jttj|}|sP|t|8}qW|jS)NrzInvalid value for whence: {})
r
SEEK_SETSEEK_CURrSEEK_ENDrr*DEFAULT_BUFFER_SIZErformatr<minr+)roffsetwhencer/rrrr;xs&

zDecompressReader.seekcCs|jS)N)r)rrrrtellszDecompressReader.tellr)rrrr	r#r%rr0r*r<r
r=r;rErr)r&rr!s*r)r
r@r5BufferedIOBaser	RawIOBaserrrrr<module>s	
Back to Directory File Manager