fileslice.py
def read(self, size=-1):
        '''
        Same as `file.read()` but for the slice. Does not read beyond
        `self.end`.
        '''
        if self.closed:
            raise ValueError('I/O operation on closed file.')
        
        if size == -1 or size > self.size - self.pos:
            size = self.size - self.pos
        
        with self.lock:
            self.f.seek(self.start + self.pos)
            result = self.f.read(size)
            self.seek(self.pos + size)
        
        return result
def read(self, size=-1):
        '''
        Same as `file.read()` but for the slice. Does not read beyond
        `self.end`.
        '''
        if self.closed:
            raise ValueError('I/O operation on closed file.')
        
        if size == -1 or size > self.size - self.pos:
            size = self.size - self.pos
        
        with self.lock:
            self.f.seek(self.start + self.pos)
            result = self.f.read(size)
            self.seek(self.pos + size)
        
        return result
Same as `file.read()` but for the slice. Does not read beyond
        `self.end`.