| 87 | } |
| 88 | |
| 89 | std::streampos ByteInputStream::tellp() const { |
| 90 | if (ranges_.empty()) { |
| 91 | return 0; |
| 92 | } |
| 93 | assert(current_); |
| 94 | int64_t size = 0; |
| 95 | for (auto& range : ranges_) { |
| 96 | if (&range == current_) { |
| 97 | return current_->position + size; |
| 98 | } |
| 99 | size += range.size; |
| 100 | } |
| 101 | BOLT_FAIL("ByteInputStream 'current_' is not in 'ranges_'."); |
| 102 | } |
| 103 | |
| 104 | void ByteInputStream::seekp(std::streampos position) { |
| 105 | if (ranges_.empty() && position == 0) { |