+
    P\iw  c                  s"   ^ RI Ht Rt^ RIt^ RIHtHtHt ^ RIH	t	H
t
 ^ RIHtHt ^R	IHtHtHtHt ^R
IHtHtHtHtHtHt ]P4                  R8  d   ^ RIHt M^ RIHt ]	! RR7       ! R R]4      4       t ! R R]]4      t ! R R]4      tR# )i    )annotationsBufferedByteReceiveStreamBufferedByteStreamBufferedConnectableN)CallableIterableMapping)	dataclassfield)AnySupportsIndex)ClosedResourceErrorDelimiterNotFoundEndOfStreamIncompleteRead)AnyByteReceiveStreamAnyByteStreamAnyByteStreamConnectableByteReceiveStream
ByteStreamByteStreamConnectable)overrideF)Zeqc                  s    ] tR t^t$ RtR]R&   ]! R]R7      tR]R&   ]! RRR7      t	R	]R
&   R R lt
]R R l4       t]R R l4       tR R ltRR R lltR R ltR R ltRtR# )r   z
Wraps any bytes-based receive stream and uses a buffer to provide sophisticated
receiving capabilities in the form of a byte stream.
r   receive_streamF)initZdefault_factory	bytearray_buffer)r   ZdefaultZbool_closedc                   V ^8  d   QhRR/#    returnNone Zformat   ";/usr/lib/python3.14/site-packages/anyio/streams/buffered.py__annotate__&BufferedByteReceiveStream.__annotate__)   s      d     c                	sd   "   V P                   P                  4       G R j  xL
  RV n        R #  L5i)NT)r   acloser   self   &r#   r'   Z BufferedByteReceiveStream.aclose)   s)     !!((*** 	+s   0.0c               r   )r   r   bytesr    r!   r"   r#   r$   r%   .   s     # # #r&   c                s,    \        V P                  4      # )z"The bytes currently in the buffer.)r+   r   r(   r*   r#   bufferZ BufferedByteReceiveStream.buffer-   s     T\\""r&   c               r   )r   r   zMapping[Any, Callable[[], Any]]r    r!   r"   r#   r$   r%   3   s     4 4"A 4r&   c                	s.    V P                   P                  # N)r   extra_attributesr(   r*   r#   r.   Z*BufferedByteReceiveStream.extra_attributes2   s    ""333r&   c                    V ^8  d   QhRRRR/# )r   datazIterable[SupportsIndex]r   r   r    r!   r"   r#   r$   r%   6   s     " "5 "T "r&   c               s<    V P                   P                  V4       R# )a  
Append data directly into the buffer.

Any data in the buffer will be consumed by receive operations before receiving
anything from the wrapped stream.

:param data: the data to append to the buffer (can be bytes or anything else
    that supports ``__index__()``)

N)r   extend)r)   r0   s   ""r#   	feed_dataZ#BufferedByteReceiveStream.feed_data6   s     	D!r&   c               r/   )r   	max_bytesintr   r+   r    r!   r"   r#   r$   r%   C   s      s u r&   c                	s  "   V P                   '       d   \        hV P                  '       d*   \        V P                  R V 4      pV P                  R V1 V# \	        V P
                  \        4      '       d$   V P
                  P                  V4      G R j  xL
 # V P
                  P                  4       G R j  xL
 p\        V4      V8  d#   V P                  P                  W!R  4       VR V # V#  LZ L:5ir-   )
r   r   r   r+   
isinstancer   r   receivelenr1   )r)   r3   chunks   && r#   r6   Z!BufferedByteReceiveStream.receiveC   s     <<<%%<<<$,,z	23EZiZ(L++->??,,44Y??? --5577E5zI%##E*$56Zi(( @ 8s)   *C3A'C3C/!C36C179C31C3c               r/   )r   nbytesr4   r   r+   r    r!   r"   r#   r$   r%   X   s     ' 'C 'E 'r&   c                s  "    V\        V P                  4      ,
          pV^ 8:  d*   V P                  RV pV P                  RV1 \        V4      #  \        V P                  \
        4      '       d%   V P                  P                  V4      G Rj  xL
 pM#V P                  P                  4       G Rj  xL
 p V P                  P                  V4       K   LE L$  \         d   p\        ThRp?ii ; i5i)z
Read exactly the given amount of bytes from the stream.

:param nbytes: the number of bytes to read
:return: the bytes read
:raises ~anyio.IncompleteRead: if the stream was closed before the requested
    amount of bytes could be read from the stream

N)
r7   r   r+   r5   r   r   r6   r   r   r1   )r)   r9   Z	remainingZretvalr8   excs   &&    r#   receive_exactlyZ)BufferedByteReceiveStream.receive_exactlyX   s      T\\!22IA~gv.LL&)V}$.d113DEE"&"5"5"="=i"HHE"&"5"5"="="??E LL& I? .$#-.sZ   AC3>C CC C3C 2C3C 7C3C C C0$C++C00C3c               s$    V ^8  d   QhRRRRRR/# )r   	delimiterr+   r3   r4   r   r    r!   r"   r#   r$   r%   s   s!     $& $&U $&s $&u $&r&   c                s8  "   \        V4      p^ p V P                  P                  W4      pV^ 8  d:   V P                  RV pV P                  RV\        V4      ,           1 \        V4      # \        V P                  4      V8  d   \	        V4      h V P
                  P                  4       G Rj  xL
 p\        \        T P                  4      T,
          ^,           ^ 4      pT P                  P                  T4       K   LN  \         d   p\        ThRp?ii ; i5i)a  
Read from the stream until the delimiter is found or max_bytes have been read.

:param delimiter: the marker to look for in the stream
:param max_bytes: maximum number of bytes that will be read before raising
    :exc:`~anyio.DelimiterNotFound`
:return: the bytes read (not including the delimiter)
:raises ~anyio.IncompleteRead: if the stream was closed before the delimiter
    was found
:raises ~anyio.DelimiterNotFound: if the delimiter is not found within the
    bytes read up to the maximum allowed

N)r7   r   Zfindr+   r   r   r6   r   r   Zmaxr1   )	r)   r<   r3   Zdelimiter_sizeZoffsetZindexZfoundr0   r:   s	   &&&      r#   receive_untilZ'BufferedByteReceiveStream.receive_untils   s      YLL%%i8EzVe,LL!;53y>#9!;<U|# 4<< I-'	22.!0088::
 T\\*^;a?CFLL% ; .$#-.s=   BDD  /C>0D  4A
D>D   DDDD)r   N)i   )__name__
__module____qualname____firstlineno____doc__Z__annotations__r   r   r   r   r'   Zpropertyr,   r.   r2   r6   r;   r=   __static_attributes__r    r&   r#   r   r      sw    
 )(E9EGYEue4GT4 # # 4 4"*'6$& $&r&   c                  s^   a  ] tR t^tRtR V 3R llt]R R l4       t]R R l4       tRt	V ;t
# )	r   zy
A full-duplex variant of :class:`BufferedByteReceiveStream`. All writes are passed
through to the wrapped stream as-is.
c               r   )r   streamr   r    r!   r"   r#   r$   BufferedByteStream.__annotate__   s      } r&   c                s2   < \         SV `  V4       Wn        R# )z*
:param stream: the stream to be wrapped

N)Zsuper__init___stream)r)   rD   	__class__s   &&r#   rF   ZBufferedByteStream.__init__   s    
 	 r&   c               r   r   r    r!   r"   r#   r$   rE      s     & & &r&   c                	sV   "   V P                   P                  4       G R j  xL
  R #  L5ir-   )rG   send_eofr(   r*   r#   rI   ZBufferedByteStream.send_eof   s     ll##%%%s   )')c               r/   )r   itemr+   r   r   r    r!   r"   r#   r$   rE      s     & &u & &r&   c                	sX   "   V P                   P                  V4      G R j  xL
  R #  L5ir-   )rG   send)r)   rJ      &&r#   rK   ZBufferedByteStream.send   s     ll%%%s   *(*)rG   )r>   r?   r@   rA   rB   rF   r   rI   rK   rC   Z__classcell__)rH   s   @r#   r   r      s:    
  & & & &r&   c                  s8    ] tR t^tR R lt]R R l4       tRtR# )r   c               r   )r   connectabler   r    r!   r"   r#   r$    BufferedConnectable.__annotate__   s     ' '$< 'r&   c                s    Wn         R# )z.
:param connectable: the connectable to wrap

NrM   )r)   rM   rL   r#   rF   ZBufferedConnectable.__init__   s
    
 'r&   c               r   )r   r   r   r    r!   r"   r#   r$   rN      s     * *1 *r&   c                	sh   "   V P                   P                  4       G R j  xL
 p\        V4      #  L5ir-   )rM   connectr   )r)   rD   s   & r#   rP   ZBufferedConnectable.connect   s,     ''//11!&)) 2s   202rO   N)r>   r?   r@   rA   rF   r   rP   rC   r    r&   r#   r   r      s    ' * *r&   )r   r   r   )i   i   ) Z
__future__r    Z__all__ZsysZcollections.abcr   r   r   Zdataclassesr   r   Ztypingr	   r
   Z r   r   r   r   Zabcr   r   r   r   r   r   Zversion_infor   Ztyping_extensionsr   r   r   r    r&   r#   <module>rQ      s    "  7 7 ( % R R  w* ex& 1 x& x&v&2J &.*/ *r&   