HEX
Server: Apache
System: Linux vpshost11508.publiccloud.com.br 5.15.179-grsec-vpshost-10.lc.el8.x86_64 #1 SMP Mon Apr 7 12:04:45 -03 2025 x86_64
User: wicomm2 (10002)
PHP: 8.3.0
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //lib/python2.7/site-packages/pyasn1/codec/streaming.pyc
�
��fc@s�ddlZddlZddlZddlmZddlmZejdkZdej	fd��YZ
d�Zd�Zdd	�Z
ddd
�ZdS(i����N(terror(tunivitCachingStreamWrappercBsqeZdZd�Zd�Zd�Zdejd�Zdd�Z	e
d��Zejd��Zd	�Z
RS(
sWrapper 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.
    cCs%||_tj�|_d|_dS(Ni(t_rawtiotBytesIOt_cachet_markedPosition(tselftraw((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pyt__init__s	cCs0|j|�}|jjt|�tj�|S(N(treadRtseektlentostSEEK_CUR(Rtntresult((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pytpeek scCstS(N(tTrue(R((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pytseekable%si����cCs|jj||�S(N(RR(RRtwhence((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pyR(scCse|jj|�}|dkr;|t|�8}|s;|Sn|jj|�}|jj|�||S(Ni����(RRR
Rtwrite(RRtread_from_cachet
read_from_raw((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pyR,scCs|jS(sPosition 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.
        (R(R((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pytmarkedPosition9scCsL||_|jj�tjkrHtj|jj��|_d|_ndS(Ni(RRttellRtDEFAULT_BUFFER_SIZERR(Rtvalue((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pyRCs	cCs
|jj�S(N(RR(R((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pyRQs(t__name__t
__module__t__doc__R
RRRtSEEK_SETRRtpropertyRtsetterR(((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pyRs				

cCs�t|tj�r|St|t�r2tj|�St|tj�rWtj|j��Sy@tr|t|t�r|tj	|�S|j
�r�|St|�SWn.tk
r�t
jd|jjd��nXdS(siConvert 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.
    sCannot convert s to a seekable bit stream.N(t
isinstanceRRtbytesRtOctetStringtasOctetst_PY2tfiletBufferedReaderRRtAttributeErrorRtUnsupportedSubstrateErrort	__class__R(t	substrate((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pytasSeekableStreamUs 



ccs�t|tj�r^|j�}|jdtj�|j�|k}|j|tj�|VnE|jd�}|dkr�dVn|r�|jdtj
�n|VdS(sCheck 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`
    iiNi����(R#RRRRRtSEEK_ENDR RtNoneR(R-tcpRtreceived((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pyt
isEndOfStream�sccs�t|d�rX|j|�}|dkr2dVnxt|�|krOdVq5W|Vn@|j�}z#xt||�D]}|VqwWWd|j|�XdS(s?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(thasattrRR0R
RtreadFromStreamR(R-tsizeR2tcurrent_positiontchunk((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pytpeekIntoStream�s	
ccs�x�tr�|j|�}|dkr8tjd|�Vq|r`|dkr`tjd|��qt|�|kr�|jt|�tj	�tjd|�VqPqW|VdS(sRead 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
    tcontextiN(
RRR0RtSubstrateUnderrunErrortEndOfStreamErrorR
RRR(R-R6R:R2((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pyR5�s	(i(RRtsystpyasn1Rtpyasn1.typeRtversion_infoR'tIOBaseRR.R3R9R0R5(((s6/tmp/pip-build-RDPAtx/pyasn1/pyasn1/codec/streaming.pyt<module>sD	+	!$