Ë £IA>ÄÂdãó˜—ddlZddlZddlZddlmZddlmZejdkZGd„dej«Z d„Z d„Z d d „Z d d „Zy) éN)Úerror)Úuniv)écó„—eZdZdZd„Zd„Zd„Zdejfd„Z d d„Z e d„«Z e jd „«Z d „Zy ) ÚCachingStreamWrapperaWrapper around non-seekable streams. Note that the implementation is tied to the decoder, not checking for dangerous arguments for the sake of performance. The read bytes are kept in an internal cache until setting _markedPosition which may reset the cache. cóR—||_tj«|_d|_y©Nr)Ú_rawÚioÚBytesIOÚ_cacheÚ_markedPosition)ÚselfÚraws ú;/usr/lib/python3.12/site-packages/pyasn1/codec/streaming.pyÚ__init__zCachingStreamWrapper.__init__s€ØˆŒ Ü—j‘j“lˆŒ Ø ˆÕócó�—|j|«}|jjt|« tj «|S©N)Úreadr ÚseekÚlenÚosÚSEEK_CUR)rÚnÚresults rÚpeekzCachingStreamWrapper.peek s2€Ø—‘˜1“ˆØ � ‰ ×Ñœ#˜f›+˜¤r§{¡{Ô3؈ rcó—y)NT©©rs rÚseekablezCachingStreamWrapper.seekable%s€Øréÿÿÿÿcó:—|jj||«Sr)r r)rrÚwhences rrzCachingStreamWrapper.seek(s€à�{‰{×Ñ  6Ó*Ð*rcóÜ—|jj|«}|dk7r|t|«z}|s|S|jj|«}|jj |«||zS)Nr")r rrr Úwrite)rrÚread_from_cacheÚ read_from_raws rrzCachingStreamWrapper.read,sd€ØŸ+™+×*Ñ*¨1Ó-ˆØ �Š7Ø ”�_Ó%Ñ %ˆAÙØ&Ð&àŸ ™ Ÿ™ qÓ)ˆ à � ‰ ×ј-Ô(à Ñ.Ð.rcó—|jS)aPosition where the currently processed element starts. This is used for back-tracking in SingleItemDecoder.__call__ and (indefLen)ValueDecoder and should not be used for other purposes. The client is not supposed to ever seek before this position. )rr s rÚmarkedPositionz#CachingStreamWrapper.markedPosition9s€ð×#Ñ#Ð#rcóÜ—||_|jj«tjkDr:tj |jj ««|_d|_yyr )rr Útellr ÚDEFAULT_BUFFER_SIZEr r)rÚvalues rr*z#CachingStreamWrapper.markedPositionCsS€ð %ˆÔð �;‰;× Ñ Ó ¤× 6Ñ 6Ò 6ÜŸ*™* T§[¡[×%5Ñ%5Ó%7Ó8ˆDŒKØ#$ˆDÕ ð 7rcó6—|jj«Sr)r r,r s rr,zCachingStreamWrapper.tellQs€Ø�{‰{×ÑÓ!Ð!rN©r")Ú__name__Ú __module__Ú __qualname__Ú__doc__rrr!rÚSEEK_SETrrÚpropertyr*Úsetterr,rrrrrs^„ñò!ò ò ð § ¡ ó+ó /ðñ$óð$ð×Ññ %óð %ó"rrcó—t|tj«r|St|t«rtj|«St|tj «r#tj|j ««S tr%t|t«rtj|«S|j«r|St|«S#t$r0tjd|jj zdz«‚wxYw)aiConvert object to seekable byte-stream. Parameters ---------- substrate: :py:class:`bytes` or :py:class:`io.IOBase` or :py:class:`univ.OctetString` Returns ------- : :py:class:`io.IOBase` Raises ------ : :py:class:`~pyasn1.error.PyAsn1Error` If the supplied substrate cannot be converted to a seekable stream. zCannot convert z to a seekable bit stream.)Ú isinstancer r ÚbytesrÚ OctetStringÚasOctetsÚ_PY2ÚfileÚBufferedReaderr!rÚAttributeErrorrÚUnsupportedSubstrateErrorÚ __class__r1)Ú substrates rÚasSeekableStreamrDUsÚ€ô �)œRŸZ™ZÔ(ØÐä �IœuÔ %Ü�z‰z˜)Ó$Ð$ä �Iœt×/Ñ/Ô 0Ü�z‰z˜)×,Ñ,Ó.Ó/Ð/ð*õ ”J˜y¬$Ô/Ü×$Ñ$ YÓ/Ð /à × Ñ Ô !ØÐ ô(¨ Ó2Ð 2øä ò*Ü×-Ñ-Ø   × 3Ñ 3× <Ñ <Ñ <Ø (ñ )ó*ð *ð*úsÂ*CÂ+CÂ= CÃ9Dc#óŒK—t|tj«rh|j«}|j dt j «|j«|k(}|j |t j«|–—y|jd«}|€d–—|r |j dt j«| –—y­w)aCheck whether we have reached the end of a stream. Although it is more effective to read and catch exceptions, this function Parameters ---------- substrate: :py:class:`IOBase` Stream to check Returns ------- : :py:class:`bool` réNr") r9r r r,rrÚSEEK_ENDr5rr)rCÚcprÚreceiveds rÚ isEndOfStreamrJ€s’èø€ô�)œRŸZ™ZÔ(Ø �^‰^Ó ˆØ�‰�qœ"Ÿ+™+Ô&Ø—‘Ó! RÑ'ˆØ�‰�rœ2Ÿ;™;Ô'Ø‹ ð—>‘> !Ó$ˆØ Ð Û á Ø �N‰N˜2œrŸ{™{Ô +àˆlÓùs‚CCc#ó:K—t|d«r=|j|«}|€d–—t|«|krd–—t|«|krŒ|–—y|j«} t ||«D]}|–—Œ |j |«y#|j |«wxYw­w)a?Peek into stream. Parameters ---------- substrate: :py:class:`IOBase` Stream to read from. size: :py:class:`int` How many bytes to peek (-1 = all available) Returns ------- : :py:class:`bytes` or :py:class:`str` The return type depends on Python major version rN)Úhasattrrrr,ÚreadFromStreamr)rCÚsizerIÚcurrent_positionÚchunks rÚpeekIntoStreamrQ¡s“èø€ô ˆy˜&Ô!Ø—>‘> $Ó'ˆØ Ð Û ä�(‹m˜dÒ"Û ô�(‹m˜dÓ"ð‹ð%Ÿ>™>Ó+Ðð -Ü'¨ °4Ö8�Ø“ ñ9ð �N‰NÐ+Õ ,øˆI�N‰NÐ+Õ ,üs$‚ABÁBÁBÁ3BÂBÂBc#óNK— |j|«}|€tj|¬«–—no|s|dk7rtj|¬«‚t |«|krC|j t |« t j«tj|¬«–—nnŒœ|–—y­w)aRead from the stream. Parameters ---------- substrate: :py:class:`IOBase` Stream to read from. Keyword parameters ------------------ size: :py:class:`int` How many bytes to read (-1 = all available) context: :py:class:`dict` Opaque caller context will be attached to exception objects created by this function. Yields ------ : :py:class:`bytes` or :py:class:`str` or :py:class:`SubstrateUnderrunError` Read data or :py:class:`~pyasn1.error.SubstrateUnderrunError` object if no `size` bytes is readily available in the stream. The data type depends on Python major version Raises ------ : :py:class:`~pyasn1.error.EndOfStreamError` Input stream is exhausted N)Úcontextr)rrÚSubstrateUnderrunErrorÚEndOfStreamErrorrrrr)rCrNrSrIs rrMrMÅs’èø€ð: à—>‘> $Ó'ˆØ Ð Ü×.Ñ.°wÔ?Ó ?á˜d ašiÜ×(Ñ(°Ô9Ð 9ä �‹]˜TÒ !Ø �N‰NœC ›M˜>¬2¯;©;Ô 7ô×.Ñ.°wÔ?Ó ?ð ð! ð$ ƒNùs‚B#B%r0)r"N)r rÚsysÚpyasn1rÚ pyasn1.typerÚ version_infor=ÚIOBaserrDrJrQrMrrrÚr[sPðó Û Û åÝà ×ј$Ñ€ôA"˜2Ÿ9™9ôA"òH(*òVóB!-ôH/r