bool BufferedStreamMgr::init() { _inputStreamMgr = new InputStreamMgr(_filename); if (!_inputStreamMgr->init()) { return false; } if (_inputStreamMgr->isBam()) { //there is a special check for a BAM file's magic string inside //the inputStreamMgr's init method. If it is found, we can //stop here. _typeChecker.setBam(); return true; } if (!getTypeData()) { return false; } if (_inputStreamMgr->isGzipped()) { _useBufSize = GZIP_LINE_BUF_SIZE; } size_t trueBufSize = max(_useBufSize, (int)_currScanBuffer.size()); _useBufSize = trueBufSize; _mainBuf = new bufType[_useBufSize +1]; memset(_mainBuf, 0, _useBufSize +1); memcpy(_mainBuf, _currScanBuffer.c_str(), _currScanBuffer.size()); _mainBufCurrLen = _currScanBuffer.size(); return true; }
bool BufferedStreamMgr::init() { _inputStreamMgr = new InputStreamMgr(_filename); if (!_inputStreamMgr->init()) { return false; } if (_inputStreamMgr->isBam()) { //there is a special check for a BAM file's magic string inside //the inputStreamMgr's init method. If it is found, we can //stop here. _typeChecker.setBam(); return true; } if (!getTypeData()) { return false; } _mainBuf = new bufType[MAIN_BUF_READ_SIZE +1]; memset(_mainBuf, 0, MAIN_BUF_READ_SIZE +1); return true; }