| 1113 | } |
| 1114 | |
| 1115 | int64_t GetPayloadSize(const IpcPayload& payload, const IpcWriteOptions& options) { |
| 1116 | const int32_t prefix_size = options.write_legacy_ipc_format ? 4 : 8; |
| 1117 | const int32_t flatbuffer_size = static_cast<int32_t>(payload.metadata->size()); |
| 1118 | const int32_t padded_message_length = static_cast<int32_t>( |
| 1119 | PaddedLength(flatbuffer_size + prefix_size, options.alignment)); |
| 1120 | // body_length already accounts for padding |
| 1121 | return payload.body_length + padded_message_length; |
| 1122 | } |
| 1123 | |
| 1124 | Status GetRecordBatchSize(const RecordBatch& batch, int64_t* size) { |
| 1125 | return GetRecordBatchSize(batch, IpcWriteOptions::Defaults(), size); |