// ILocalIODevice_p.cpp (c) 2011 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
-// Last modified: 25 October 2011 (DB)
+// Last modified: 27 July 2012 (DB)
// ---------------------------------------------------------------------------
// Provides shared behavior for files & pipes
// ***************************************************************************
int64_t ILocalIODevice::Read(char* data, const unsigned int numBytes) {
BT_ASSERT_X( m_stream, "ILocalIODevice::Read: trying to read from null stream" );
- BT_ASSERT_X( (m_mode == IBamIODevice::ReadOnly), "ILocalIODevice::Read: device not in read-only mode");
+ BT_ASSERT_X( (m_mode & IBamIODevice::ReadOnly), "ILocalIODevice::Read: device not in read-able mode");
return static_cast<int64_t>( fread(data, sizeof(char), numBytes, m_stream) );
}
int64_t ILocalIODevice::Write(const char* data, const unsigned int numBytes) {
BT_ASSERT_X( m_stream, "ILocalIODevice::Write: tryint to write to null stream" );
- BT_ASSERT_X( (m_mode == IBamIODevice::WriteOnly), "ILocalIODevice::Write: device not in write-only mode" );
+ BT_ASSERT_X( (m_mode & IBamIODevice::WriteOnly), "ILocalIODevice::Write: device not in write-able mode" );
return static_cast<int64_t>( fwrite(data, sizeof(char), numBytes, m_stream) );
}