Ejemplo n.º 1
0
        public void AddIndex(uint offset, UInt32 length)
        {
            var indexRec = new IndexRecord(offset, length);

            _indexes.Add(indexRec);
            IsDirty = true;
        }
Ejemplo n.º 2
0
        // Loads index from index file
        private void Load()
        {
            if (!File.Exists(IndexFilename))
            {
                throw new FileNotFoundException($"The file {IndexFilename} does not exist.");
            }

            using (var fs = File.OpenRead(IndexFilename))
            {
                using (var br = new BinaryReader(fs))
                {
                    while (br.BaseStream.Position != br.BaseStream.Length)
                    {
                        var indexRec = new IndexRecord(br.ReadUInt32(), br.ReadUInt32());
                        _indexes.Add(indexRec);
                    }
                }
            }
        }