def input(self, data):
self.buf += data<EOL>while len(self.buf) > HEADER_SIZE:<EOL><INDENT>data_len = struct.unpack('<STR_LIT:i>', self.buf[<NUM_LIT:0>:HEADER_SIZE])[<NUM_LIT:0>]<EOL>if len(self.buf) >= data_len + HEADER_SIZE:<EOL><INDENT>content = self.buf[HEADER_SIZE:data_len + HEADER_SIZE]<EOL>self.buf = self.buf[data_len + HEADER_SIZE:]<EOL>yield content<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>
小数据片段拼接成完整数据包
            如果内容足够则yield数据包