private static ExitCodes ProgramExecution() { using (var indexStream = FileUtilities.GetReadStream(_inputIndexFile)) using (var outStream = FileUtilities.GetCreateStream(_outputIndexFile)) using (var extWriter = new ExtendedBinaryWriter(outStream)) { var version = DataSourceVersionReader.GetSourceVersion(_versionFile); var oldIndex = new NsaIndex(indexStream); var newIndex = new NsaIndex(extWriter, oldIndex.Assembly, version, oldIndex.JsonKey, oldIndex.MatchByAllele, oldIndex.IsArray, oldIndex.SchemaVersion, oldIndex.IsPositional); newIndex.Write(oldIndex.GetBlocks()); } return(ExitCodes.Success); }
public void Dispose() { _index.Write(); if (!_leaveOpen) { _writer?.Dispose(); _indexWriter?.Dispose(); _stream?.Dispose(); _indexStream?.Dispose(); _block?.Dispose(); } _memWriter?.Dispose(); _memStream?.Dispose(); }