// close BAM file public override void Close() { if (!IsOpen) { return; } IsOpen = false; _header = ""; _reader.Dispose(); //.net core changes BgzfFileStream.Dispose(); //.net core changes }
// close BAM file public override void Close() { if (!IsOpen) { return; } IsOpen = false; _header = ""; _reader.Close(); BgzfFileStream.Close(); }
// returns file pointer to beginning of alignments public void Rewind() { BlockLength = 0; BlockOffset = (int)(_alignmentsOffset & 0xFFFF); BlockAddress = (_alignmentsOffset >> 16) & 0xFFFFFFFFFFFF; try { BgzfFileStream.Seek(BlockAddress, SeekOrigin.Begin); } catch (IOException e) { throw new ApplicationException(string.Format("ERROR: Unable to seek in the BAM file: {0}", e.Message)); } }
// close Bgzipped file public override void Close() { if (!IsOpen) { return; } IsOpen = false; // flush the current BGZF block FlushBlock(); if (_compressQueue != null) { // Signal that we're not going to add any more data to the queue. _compressQueue.CompleteAdding(); // Wait for our compression threads to finish. int numCompressionThreads = _compressionThreads.Length; for (int i = 0; i < numCompressionThreads; ++i) { _compressionThreads[i].Join(); } // Signal to the writing thread that compression is complete. _writeQueue.CompleteAdding(); // Wait for the writing thread to finish. _writingThread.Join(); } // write an empty block (as EOF marker) FlushSingleBlock(); //_writer.Close(); not supported with .net core //BgzfFileStream.Close();not supported with .net core _writer.Dispose(); BgzfFileStream.Dispose(); }