def read(self, size=-1):
        """read at most size bytes from the file"""
        if self.closed:
            raise ValueError("I/O operation on closed file")
        if ((size + self._tf.tell()) > self._read) or (size < 0):
            ccp = self._tf.tell()
            if size >= 0:
                tr = size - (self._read - ccp)
                content = self._raw.read(tr)
            else:
                content = self._raw.read()
            self._read += len(content)
            self._tf.seek(0, os.SEEK_END)
            self._tf.write(content)
            self._tf.seek(ccp, os.SEEK_SET)
        return self._tf.read(size)
read at most size bytes from the file
lib/stashutils/fsi/DropBox.py