Update the sizes of our Protobuf fields based on the given IPC payload.
| 628 | |
| 629 | // Update the sizes of our Protobuf fields based on the given IPC payload. |
| 630 | arrow::Status IpcMessageHeaderSize(const arrow::ipc::IpcPayload& ipc_msg, bool has_body, |
| 631 | size_t* header_size, int32_t* metadata_size) { |
| 632 | DCHECK_LE(ipc_msg.metadata->size(), kInt32Max); |
| 633 | *metadata_size = static_cast<int32_t>(ipc_msg.metadata->size()); |
| 634 | |
| 635 | // 1 byte for metadata tag |
| 636 | *header_size += 1 + WireFormatLite::LengthDelimitedSize(*metadata_size); |
| 637 | |
| 638 | // 2 bytes for body tag |
| 639 | if (has_body) { |
| 640 | // We write the body tag in the header but not the actual body data |
| 641 | *header_size += 2 + WireFormatLite::LengthDelimitedSize(ipc_msg.body_length) - |
| 642 | ipc_msg.body_length; |
| 643 | } |
| 644 | |
| 645 | return arrow::Status::OK(); |
| 646 | } |
| 647 | |
| 648 | bool ReadBytesZeroCopy(const std::shared_ptr<Buffer>& source_data, |
| 649 | CodedInputStream* input, std::shared_ptr<Buffer>* out) { |
no test coverage detected