+
    Dfj	                         R t ^ RIHt ^ RIHtHtHtHt ^ RIH	t	H
t
 ^ RIHtHtHtHt ]! R4      t ! R R]4      t ! R R	]4      t]
 ! R
 R4      4       tR R ltR R ltR# )z
Buffer byte streams.
)count)DictIteratorListTypeVar)Factorydefine)AMPCommandIntegerStringTc                   .    ] tR t^tRtR]! 4       3.tRtR# )
StreamOpenz
Open a new stream.
   streamId N)__name__
__module____qualname____firstlineno____doc__r   response__static_attributes__r       </usr/lib/python3/dist-packages/twisted/trial/_dist/stream.pyr   r      s     gi()Hr   r   c                   >    ] tR t^tRtR]! 4       3R]! 4       3.tRtR# )StreamWritez$
Write a chunk of data to a stream.
r   s   datar   N)	r   r   r   r   r   r   Bytes	argumentsr   r   r   r   r   r      s$    
 
gi 	%'Ir   r   c                      a  ] tR t^"t o Rt]! 4       t]! ]4      t	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R ltR	tV tR
# )StreamReceiverz1
Buffering de-multiplexing byte stream receiver.
c                    < V ^8  d   QhRS[ /# )   return)int)format__classdict__s   "r   __annotate__StreamReceiver.__annotate__+   s      c r   c                N    \        V P                  4      p. V P                  V&   V# )z5
Open a new stream and return its unique identifier.
)next_counter_streams)selfnewIds   & r   openStreamReceiver.open+   s%     T]]#!er   c                *   < V ^8  d   QhRS[ RS[RR/# )r"   streamIdchunkr#   N)r$   bytes)r%   r&   s   "r   r'   r(   3   s"     . .c .% .D .r   c                J    V P                   V,          P                  V4       R# )zi
Write to an open stream using its unique identifier.

@raise KeyError: If there is no such open stream.
N)r,   append)r-   r2   r3   s   &&&r   writeStreamReceiver.write3   s     	h&&u-r   c                6   < V ^8  d   QhRS[ RS[S[,          /# )r"   r2   r#   )r$   r   r4   )r%   r&   s   "r   r'   r(   ;   s     + +s +tE{ +r   c                8    V P                   P                  V4      # )z
Indicate an open stream may receive no further data and return all of
its current contents.

@raise KeyError: If there is no such open stream.
)r,   pop)r-   r2   s   &&r   finishStreamReceiver.finish;   s     }}  **r   c                h   < V ^8  d   Qh/ S[ S[,          ;R&   S[S[S[S[,          3,          ;R&   # )r"   r+   r,   )r   r$   r   r   r4   )r%   r&   s   "r   r'   r(   "   s1      sm%  3U#$4 r   r   N)r   r   r   r   r   r   r+   r   dictr,   r/   r7   r<   __annotate_func__r   __classdictcell__)r&   s   @r   r    r    "   sA      $gH'.t}H . .+ +3  r   r    c                R    V ^8  d   QhR\         R\        R\        \         ,          /# )r"   data	chunkSizer#   )r4   r$   r   )r%   s   "r   r'   r'   E   s%       # (5/ r   c              #  ^   "   ^ pV\        V 4      8  d   WW!,            x  W!,          pK&  R# 5i)z
Break a byte string into pieces of no more than ``chunkSize`` length.

@param data: The byte string.

@param chunkSize: The maximum length of the resulting pieces.  All pieces
    except possibly the last will be this length.

@return: The pieces.
N)len)rC   rD   poss   && r   r3   r3   E   s1      C
D	/)) s   +-c                R    V ^8  d   QhR\         R\        \        ,          R\        /# )r"   ampchunksr#   )r	   r   r4   r$   )r%   s   "r   r'   r'   V   s%      c 8E? s r   c                   "   V P                  \        4      G Rj  xL
 R,          p\        V\        4      '       g   Q hV F"  pV P                  \        W#R7      G Rj  xL
  K$  	  V#  LM L5i)z
Send the given stream chunks, one by one, over the given connection.

The chunks are sent using L{StreamWrite} over a stream opened using
L{StreamOpen}.

@return: The identifier of the stream over which the chunks were sent.
Nr2   )r2   rC   )
callRemoter   
isinstancer$   r   )rI   rJ   r2   oneChunks   &&  r   streamrO   V   s`      nnZ00*=Hh$$$$nn[8nKKK O 1 	Ls"   A-A)AA-A+A-+A-N)r   	itertoolsr   typingr   r   r   r   attrsr   r   twisted.protocols.ampr	   r
   r   r   r   r   r   r   r    r3   rO   r   r   r   <module>rT      sc     0 0 ! H HCL* *'  + + +D"r   