示例#1
0
        private void EnsureLoaded()
        {
            lock (this)
            {
                if (_loaded)
                    return;

                using (var stream = File.OpenRead(this.Location))
                {
                    stream.Seek(ShaTableOffset, SeekOrigin.Begin);
                    for (int i = 0; i < Size; i++)
                    {
                        var id = stream.ReadId();
                        var entry = new PackIndexEntry(id, i, -1, -1);
                        _entries.Add(id, entry);
                    }
                }

                _loaded = true;
            }
        }
示例#2
0
 private int OffsetOffset(PackIndexEntry entry)
 {
     return OffsetTableOffset + entry.Index * 4;
 }
示例#3
0
 private int CrcOffset(PackIndexEntry entry)
 {
     return CrcTableOffset + entry.Index * 4;
 }