Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public void Dispose()
        {
            _index.Write();

            if (!_leaveOpen)
            {
                _writer?.Dispose();
                _indexWriter?.Dispose();
                _stream?.Dispose();
                _indexStream?.Dispose();
                _block?.Dispose();
            }

            _memWriter?.Dispose();
            _memStream?.Dispose();
        }