def read(self, size=None):
if size is not None:<EOL><INDENT>return self.__sf.read(size)<EOL><DEDENT>block_size = self.__class__.__block_size<EOL>b = bytearray()<EOL>received_bytes = <NUM_LIT:0><EOL>while <NUM_LIT:1>:<EOL><INDENT>partial = self.__sf.read(block_size)<EOL><INDENT>self.__log.debug("<STR_LIT>" % <EOL>(block_size, len(partial)))<EOL><DEDENT>b.extend(partial)<EOL>received_bytes += len(partial)<EOL>if len(partial) < block_size:<EOL><INDENT>self.__log.debug("<STR_LIT>")<EOL>break<EOL><DEDENT><DEDENT>self.__log.debug("<STR_LIT>" % (received_bytes))<EOL>return b<EOL>
Read a length of bytes. Return empty on EOF. If 'size' is omitted, 
        return whole file.