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

Function ParseCiphertextTotalLength

cpp/src/parquet/bloom_filter.cc:76–84  ·  view source on GitHub ↗

Parse the 4-byte little-endian length prefix and return the total ciphertext size, including the 4-byte length field itself.

Source from the content-addressed store, hash-verified

74/// Parse the 4-byte little-endian length prefix and return the total ciphertext size,
75/// including the 4-byte length field itself.
76int64_t ParseCiphertextTotalLength(const uint8_t* data, int64_t length) {
77 if (length < kCiphertextLengthSize) {
78 throw ParquetException("Ciphertext length buffer is too small");
79 }
80 uint32_t buffer_size =
81 (static_cast<uint32_t>(data[3]) << 24) | (static_cast<uint32_t>(data[2]) << 16) |
82 (static_cast<uint32_t>(data[1]) << 8) | (static_cast<uint32_t>(data[0]));
83 return static_cast<int64_t>(buffer_size) + kCiphertextLengthSize;
84}
85
86void CheckBloomFilterShortRead(int64_t expected, int64_t actual,
87 std::string_view context) {

Callers 1

Calls 1

ParquetExceptionFunction · 0.85

Tested by

no test coverage detected