def _loadchunk(self, offset, length):
        if self._inline:
            df = self.opener(self.indexfile)
        else:
            df = self.opener(self.datafile)

        readahead = max(65536, length)
        df.seek(offset)
        d = df.read(readahead)
        df.close()
        self._addchunk(offset, d)
        if readahead > length:
            return util.buffer(d, 0, length)
        return d