def read(self, length=-<NUM_LIT:1>):
_complain_ifclosed(self.closed)<EOL>if length < <NUM_LIT:0>:<EOL><INDENT>length = self.size<EOL><DEDENT>chunks = []<EOL>while <NUM_LIT:1>:<EOL><INDENT>if length <= <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>c = self.f.read(min(self.buff_size, length))<EOL>if c == b"<STR_LIT>":<EOL><INDENT>break<EOL><DEDENT>chunks.append(c)<EOL>length -= len(c)<EOL><DEDENT>data = b"<STR_LIT>".join(chunks)<EOL>if self.__encoding:<EOL><INDENT>return data.decode(self.__encoding, self.__errors)<EOL><DEDENT>else:<EOL><INDENT>return data<EOL><DEDENT>
Read ``length`` bytes from the file.  If ``length`` is negative or
omitted, read all data until EOF.

:type length: int
:param length: the number of bytes to read
:rtype: string
:return: the chunk of data read from the file