Logo Search packages:      
Sourcecode: pbzip2 version File versions  Download package

int pbzip2::BZ2StreamScanner::appendOutBuffDataUpToLimit (  ) [private]

Append available data from [current, search pos) to output buffer but just up to fill current out buffer capacity

Definition at line 215 of file BZ2StreamScanner.cpp.

{
      size_t maxCapacity = std::max( getOutBuffCapacityLimit(), _outBuffCapacity );
      int maxAddition = maxCapacity - _outBuff.bufSize;
      if (maxAddition <= 0 )
      {
            return 0;
      }

      CharType * end1;
      if ( eof() )
      {
            end1 = getInBuffEnd();
      }
      else
      {
            // subtract header size to keep the tail (since start of next header may be in it)
            end1 = std::min( getInBuffSearchPtr(), getInBuffEnd() - ( getHeaderSize() - 1 ) );
      }
      CharType * end2 = getInBuffCurrent() + maxAddition;
      CharType * end = std::min( end1, end2 );

      return appendOutBuffData( end );
}

Generated by  Doxygen 1.6.0   Back to index