def read(self, size=None):
if size is None:<EOL><INDENT>t = []<EOL>while True:<EOL><INDENT>buf = self._read(self.bufsize)<EOL>if not buf:<EOL><INDENT>break<EOL><DEDENT>t.append(buf)<EOL><DEDENT>buf = "<STR_LIT>".join(t)<EOL><DEDENT>else:<EOL><INDENT>buf = self._read(size)<EOL><DEDENT>self.pos += len(buf)<EOL>return buf<EOL>
Return the next size number of bytes from the stream.
           If size is not defined, return all bytes of the stream
           up to EOF.