Returns the minimum buffer size needed to use the encoder for 'bit_width' This is the maximum length of a single run for 'bit_width'. It is not valid to pass a buffer less than this length.
| 675 | /// This is the maximum length of a single run for 'bit_width'. |
| 676 | /// It is not valid to pass a buffer less than this length. |
| 677 | static int64_t MinBufferSize(int bit_width) { |
| 678 | // 1 indicator byte and MAX_VALUES_PER_LITERAL_RUN 'bit_width' values. |
| 679 | int64_t max_literal_run_size = |
| 680 | 1 + ::arrow::bit_util::BytesForBits(MAX_VALUES_PER_LITERAL_RUN * bit_width); |
| 681 | // Up to kMaxVlqByteLength indicator and a single 'bit_width' value. |
| 682 | int64_t max_repeated_run_size = bit_util::kMaxLEB128ByteLenFor<int32_t> + |
| 683 | ::arrow::bit_util::BytesForBits(bit_width); |
| 684 | return std::max(max_literal_run_size, max_repeated_run_size); |
| 685 | } |
| 686 | |
| 687 | /// Returns the maximum byte size it could take to encode 'num_values'. |
| 688 | /// |
nothing calls this directly
no test coverage detected