// BamFile_p.cpp (c) 2011 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
-// Last modified: 25 October 2011 (DB)
+// Last modified: 10 November 2011 (DB)
// ---------------------------------------------------------------------------
// Provides BAM file-specific IO behavior
// ***************************************************************************
m_stream = fopen(m_filename.c_str(), "rb");
else if ( mode == IBamIODevice::WriteOnly )
m_stream = fopen(m_filename.c_str(), "wb");
+ else if ( mode == IBamIODevice::ReadWrite )
+ m_stream = fopen(m_filename.c_str(), "w+b");
else {
SetErrorString("BamFile::Open", "unknown open mode requested");
return false;
return true;
}
-bool BamFile::Seek(const int64_t& position) {
+bool BamFile::Seek(const int64_t& position, const int origin) {
BT_ASSERT_X( m_stream, "BamFile::Seek() - null stream" );
- return ( fseek64(m_stream, position, SEEK_SET) == 0 );
+ return ( fseek64(m_stream, position, origin) == 0 );
}