| 470 | // own data. |
| 471 | |
| 472 | static inline int64_t ReadByteArray(const uint8_t* data, int64_t data_size, |
| 473 | ByteArray* out) { |
| 474 | if (ARROW_PREDICT_FALSE(data_size < 4)) { |
| 475 | ParquetException::EofException(); |
| 476 | } |
| 477 | const int32_t len = SafeLoadAs<int32_t>(data); |
| 478 | if (len < 0) { |
| 479 | throw ParquetException("Invalid BYTE_ARRAY value"); |
| 480 | } |
| 481 | const int64_t consumed_length = static_cast<int64_t>(len) + 4; |
| 482 | if (ARROW_PREDICT_FALSE(data_size < consumed_length)) { |
| 483 | ParquetException::EofException(); |
| 484 | } |
| 485 | *out = ByteArray{static_cast<uint32_t>(len), data + 4}; |
| 486 | return consumed_length; |
| 487 | } |
| 488 | |
| 489 | template <> |
| 490 | inline int DecodePlain<ByteArray>(const uint8_t* data, int64_t data_size, int num_values, |
no test coverage detected