7 #include <packager/media/base/bit_writer.h>
9 #include <absl/log/check.h>
15 : storage_(storage), initial_storage_size_(storage_->size()) {}
18 DCHECK_NE(number_of_bits, 0u);
19 DCHECK_LE(number_of_bits, 32u);
20 DCHECK_LT(bits, 1ULL << number_of_bits);
22 num_bits_ += number_of_bits;
23 DCHECK_LE(num_bits_, 64);
24 bits_ |=
static_cast<uint64_t
>(bits) << (64 - num_bits_);
26 while (num_bits_ >= 8) {
27 storage_->push_back(bits_ >> 56);
34 while (num_bits_ > 0) {
35 storage_->push_back(bits_ >> 56);
All the methods that are virtual are virtual for mocking.