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

Function ParseCiphertextTotalLength

cpp/src/parquet/bloom_filter.cc:44–52  ·  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

42/// Parse the 4-byte little-endian length prefix and return the total ciphertext size,
43/// including the 4-byte length field itself.
44int64_t ParseCiphertextTotalLength(const uint8_t* data, int64_t length) {
45 if (length < kCiphertextLengthSize) {
46 throw ParquetException("Ciphertext length buffer is too small");
47 }
48 uint32_t buffer_size =
49 (static_cast<uint32_t>(data[3]) << 24) | (static_cast<uint32_t>(data[2]) << 16) |
50 (static_cast<uint32_t>(data[1]) << 8) | (static_cast<uint32_t>(data[0]));
51 return static_cast<int64_t>(buffer_size) + kCiphertextLengthSize;
52}
53
54void CheckBloomFilterShortRead(int64_t expected, int64_t actual,
55 std::string_view context) {

Callers 1

Calls 1

ParquetExceptionFunction · 0.85

Tested by

no test coverage detected