MCPcopy Create free account
hub / github.com/apache/arrow / Flush

Method Flush

cpp/src/arrow/util/bit_stream_utils_internal.h:227–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227inline 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
240inline uint8_t* BitWriter::GetNextBytePtr(int num_bytes) {
241 Flush(/* align */ true);

Callers

nothing calls this directly

Calls 2

BytesForBitsFunction · 0.85
ToLittleEndianFunction · 0.70

Tested by

no test coverage detected