| 454 | // Decode routine templated on C++ type rather than type enum |
| 455 | template <typename T> |
| 456 | inline int DecodePlain(const uint8_t* data, int64_t data_size, int num_values, |
| 457 | int type_length, T* out) { |
| 458 | int64_t bytes_to_decode = num_values * static_cast<int64_t>(sizeof(T)); |
| 459 | if (bytes_to_decode > data_size || bytes_to_decode > INT_MAX) { |
| 460 | ParquetException::EofException(); |
| 461 | } |
| 462 | // If bytes_to_decode == 0, data could be null |
| 463 | if (bytes_to_decode > 0) { |
| 464 | memcpy(out, data, static_cast<size_t>(bytes_to_decode)); |
| 465 | } |
| 466 | return static_cast<int>(bytes_to_decode); |
| 467 | } |
| 468 | |
| 469 | // Template specialization for BYTE_ARRAY. The written values do not own their |
| 470 | // own data. |
nothing calls this directly
no outgoing calls
no test coverage detected