| 698 | |
| 699 | template <class T> |
| 700 | int64_t Serialize(const T* obj, ArrowOutputStream* out, |
| 701 | Encryptor* encryptor = NULLPTR) { |
| 702 | auto out_buffer = SerializeToBuffer(obj); |
| 703 | |
| 704 | // obj is not encrypted |
| 705 | if (encryptor == NULLPTR) { |
| 706 | PARQUET_THROW_NOT_OK( |
| 707 | out->Write(out_buffer.data(), static_cast<int64_t>(out_buffer.size()))); |
| 708 | return static_cast<int64_t>(out_buffer.size()); |
| 709 | } else { // obj is encrypted |
| 710 | return SerializeEncryptedObj(out, out_buffer, encryptor); |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | private: |
| 715 | template <class T> |