Parse the 4-byte little-endian length prefix and return the total ciphertext size, including the 4-byte length field itself.
| 42 | /// Parse the 4-byte little-endian length prefix and return the total ciphertext size, |
| 43 | /// including the 4-byte length field itself. |
| 44 | int64_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 | |
| 54 | void CheckBloomFilterShortRead(int64_t expected, int64_t actual, |
| 55 | std::string_view context) { |
no test coverage detected