Resets the read to start reading from the start of 'buffer'. The buffer's length is 'buffer_len'. Does not take ownership of the buffer.
| 303 | /// Resets the read to start reading from the start of 'buffer'. The buffer's |
| 304 | /// length is 'buffer_len'. Does not take ownership of the buffer. |
| 305 | void Reset(const uint8_t* buffer, int buffer_len) { |
| 306 | buffer_ = buffer; |
| 307 | max_bytes_ = buffer_len; |
| 308 | byte_offset_ = 0; |
| 309 | bit_offset_ = 0; |
| 310 | int num_bytes = std::min(8, max_bytes_); |
| 311 | memcpy(&buffered_values_, buffer_, num_bytes); |
| 312 | } |
| 313 | |
| 314 | /// Gets the next value from the buffer. Returns true if 'v' could be read or false if |
| 315 | /// there are not enough bytes left. num_bits must be <= 32. |
no test coverage detected