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; } }
private int OffsetOffset(PackIndexEntry entry) { return OffsetTableOffset + entry.Index * 4; }
private int CrcOffset(PackIndexEntry entry) { return CrcTableOffset + entry.Index * 4; }