| 121 | } |
| 122 | |
| 123 | void ByteInputStream::next(bool throwIfPastEnd) { |
| 124 | BOLT_CHECK(current_ >= &ranges_[0]); |
| 125 | size_t position = current_ - &ranges_[0]; |
| 126 | BOLT_CHECK_LT(position, ranges_.size()); |
| 127 | if (position == ranges_.size() - 1) { |
| 128 | if (throwIfPastEnd) { |
| 129 | BOLT_FAIL("Reading past end of ByteInputStream"); |
| 130 | } |
| 131 | return; |
| 132 | } |
| 133 | ++current_; |
| 134 | current_->position = 0; |
| 135 | } |
| 136 | |
| 137 | uint8_t ByteInputStream::readByte() { |
| 138 | if (current_->position < current_->size) { |
no test coverage detected