public void Dispose() { DbDescriptorFileUtility.Write(_descriptorFileStream, _descriptor); _descriptorFileStream.Close(); _indexFileStream.Close(); _dataFileStream.Close(); _descriptor = null; }
private void InitDescriptor() { var descriptorFilePath = string.Join("\\", _directoryPath, "db.descriptor"); bool exists = File.Exists(descriptorFilePath); _descriptorFileStream = new FileStream(descriptorFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read); if (exists) { _descriptor = DbDescriptorFileUtility.Read(_descriptorFileStream); } else { _descriptor = new DbDescriptor(); } }