code: def read(self, size=None):
          
  
          if size is not None:
              return self.__sf.read(size)
  
          block_size = self.__class__.__block_size
  
          b = bytearray()
          received_bytes = 0
          while 1:
              partial = self.__sf.read(block_size)
  #            self.__log.debug("Reading (%d) bytes. (%d) bytes returned." % 
  #                             (block_size, len(partial)))
  
              b.extend(partial)
              received_bytes += len(partial)
  
              if len(partial) < block_size:
                  self.__log.debug("End of file.")
                  break
  
          self.__log.debug("Read (%d) bytes for total-file." % (received_bytes))
  
          return b
docs: Read a length of bytes. Return empty on EOF. If 'size' is omitted, 
          return whole file.