// Marth Lab, Department of Biology, Boston College
// All rights reserved.
// ---------------------------------------------------------------------------
-// Last modified: 21 March 2011(DB)
+// Last modified: 5 April 2011(DB)
// ---------------------------------------------------------------------------
// Based on BGZF routines developed at the Broad Institute.
// Provides the basic functionality for reading & writing BGZF files
}
// seek to position in BGZF file
-bool BgzfStream::Seek(int64_t position) {
+bool BgzfStream::Seek(const int64_t& position) {
// skip if not open
if ( !IsOpen ) return false;
return false;
}
- // update block data
+ // update block data & return success
BlockLength = 0;
BlockAddress = blockAddress;
BlockOffset = blockOffset;
-
- // return success
return true;
}
}
// get file position in BGZF file
-int64_t BgzfStream::Tell(void) {
-
- // skip if file not open
- if ( !IsOpen ) return false;
-
- // otherwise return file pointer position
+int64_t BgzfStream::Tell(void) const {
+ if ( !IsOpen )
+ return 0;
return ( (BlockAddress << 16) | (BlockOffset & 0xFFFF) );
}