| 225 | } |
| 226 | |
| 227 | inline void BitWriter::Flush(bool align) { |
| 228 | int num_bytes = static_cast<int>(bit_util::BytesForBits(bit_offset_)); |
| 229 | ARROW_DCHECK_LE(byte_offset_ + num_bytes, max_bytes_); |
| 230 | auto buffered_values = arrow::bit_util::ToLittleEndian(buffered_values_); |
| 231 | memcpy(buffer_ + byte_offset_, &buffered_values, num_bytes); |
| 232 | |
| 233 | if (align) { |
| 234 | buffered_values_ = 0; |
| 235 | byte_offset_ += num_bytes; |
| 236 | bit_offset_ = 0; |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | inline uint8_t* BitWriter::GetNextBytePtr(int num_bytes) { |
| 241 | Flush(/* align */ true); |
nothing calls this directly
no test coverage detected