]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/internal/BgzfStream_p.cpp
Merge branches 'master' and 'iodevice' into iodevice
[bamtools.git] / src / api / internal / BgzfStream_p.cpp
index b79164decabcf7d49feba9c6455da4eed96fa979..3b7074950031b7e0a92fd1c653348a69b2e63174 100644 (file)
@@ -1,7 +1,6 @@
 // ***************************************************************************
 // BgzfStream_p.cpp (c) 2011 Derek Barnett
 // Marth Lab, Department of Biology, Boston College
-// All rights reserved.
 // ---------------------------------------------------------------------------
 // Last modified: 9 September 2011(DB)
 // ---------------------------------------------------------------------------
@@ -428,8 +427,10 @@ bool BgzfStream::Seek(const int64_t& position) {
     BT_ASSERT_X( m_device, "BgzfStream::Seek() - trying to seek on null IO device");
 
     // skip if not open or not seek-able
-    if ( !IsOpen() || !m_device->IsRandomAccess() )
+    if ( !IsOpen() /*|| !m_device->IsRandomAccess()*/ ) {
+        cerr << "BgzfStream::Seek() - device not open" << endl;
         return false;
+    }
 
     // determine adjusted offset & address
     int     blockOffset  = (position & 0xFFFF);
@@ -437,7 +438,7 @@ bool BgzfStream::Seek(const int64_t& position) {
 
     // attempt seek in file
     if ( !m_device->Seek(blockAddress) ) {
-        fprintf(stderr, "BgzfStream ERROR: unable to seek in file\n");
+        cerr << "BgzfStream ERROR: unable to seek in file" << endl;
         return false;
     }