l#g<GddeZGddZdS)c0eZdZdZdZdZdZdZdZdS) LineBufferz Allows to accumulate data, and than iterate over it getting tokens split by line breaks ' '. If at the end there is no line break, the data will sit in the line buffer until more data with line break comes in. cd|_dSNbufselfs Q/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/buffer.py__init__zLineBuffer.__init__ c&|xj|z c_dSNrr datas r appendzLineBuffer.append s Drc|Srr s r __iter__zLineBuffer.__iter__ rc|jd}|dkr(|jd|}|j|dzd|_|St)N )rfind StopIteration)r posresults r __next__zLineBuffer.__next__sNhmmD!! "99Xae_Fxa *DHMrcd|_dSrrr s r cleanzLineBuffer.cleanr rN) __name__ __module__ __qualname____doc__r rrr!r#rrr rrsirrc(eZdZddZdZdZdZdS) SizeBufferc"d|_||_dS)Nr)_buf _size_len)r size_lens r r zSizeBuffer.__init__s !rc&|xj|z c_dSr)r,rs r rzSizeBuffer.append#s T rc|Srrr s r rzSizeBuffer.__iter__&rrcD|jstt|jd|jd}t |j|jd|kr:|j|j|j|z}|j|j|zd|_|St)Nbig)r,rint from_bytesr-len)r sizers r r!zSizeBuffer.__next__)sy  ~~di(8$.(895AA ty))* + +t 3 39T^dnt.CCDD $.4"7"9"9:DIKrN)r*)r$r%r&r rrr!rrr r)r)sU""""rr)N)objectrr)rrr r8sa:r