/* */ #include "TruncFileAllocationIterator.h" #include "DlAbortEx.h" namespace aria2 { TruncFileAllocationIterator::TruncFileAllocationIterator(BinaryStream* stream, int64_t offset, int64_t totalLength) : stream_(stream), offset_(offset), totalLength_(totalLength) { } void TruncFileAllocationIterator::allocateChunk() { stream_->allocate(0, totalLength_, true); offset_ = totalLength_; } bool TruncFileAllocationIterator::finished() { return offset_ == totalLength_; } int64_t TruncFileAllocationIterator::getCurrentLength() { return offset_; } int64_t TruncFileAllocationIterator::getTotalLength() { return totalLength_; } } // namespace aria2