'Create a PackData object representing the pack in the given filename.
The file must exist and stay readable until the object is disposed of.
It must also stay the same size. It will be mapped whenever needed.
Currently there is a restriction on the size of the pack as the python
mmap implementation is flawed.'

def __init__(self, filename, file=None, size=None):

    self._filename = filename
    self._size = size
    self._header_size = 12
    if (file is None):
        self._file = GitFile(self._filename, 'rb')
    else:
        self._file = file
    (version, self._num_objects) = read_pack_header(self._file.read)
    self._offset_cache = LRUSizeCache(((1024 * 1024) * 20), compute_size=_compute_object_size)
    self.pack = None
