-// opens the BGZF file for reading (mode is either "rb" for reading, or "wb" for writing)
-void BgzfStream::Open(const string& filename, const char* mode) {
-
- // make sure we're starting with fresh state
- if ( IsOpen )
- Close();
-
- // determine open mode
- if ( strcmp(mode, "rb") == 0 )
- IsWriteOnly = false;
- else if ( strcmp(mode, "wb") == 0)
- IsWriteOnly = true;
- else {
- const string message = string("unknown file mode: ") + mode;
- throw BamException("BgzfStream::Open", message);
- }