MCPcopy Create free account
hub / github.com/apache/arrow / CheckBodyLength

Function CheckBodyLength

cpp/src/arrow/ipc/reader.cc:1268–1278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1266
1267template <typename MessagePtr>
1268Result<MessagePtr> CheckBodyLength(MessagePtr message, const FileBlock& block) {
1269 if (message->body_length() != block.body_length) {
1270 return Status::Invalid(
1271 "Mismatching body length for IPC message "
1272 "(Block.bodyLength: ",
1273 block.body_length, " vs. Message.bodyLength: ", message->body_length(), ")");
1274 }
1275 // NOTE: we cannot check metadata length as easily as we would have to account
1276 // for the additional IPC signalisation (such as optional continuation bytes).
1277 return message;
1278}
1279
1280Result<std::unique_ptr<Message>> ReadMessageFromBlock(
1281 const FileBlock& block, io::RandomAccessFile* file,

Callers 2

ReadMessageFromBlockFunction · 0.85

Calls 2

InvalidFunction · 0.50
body_lengthMethod · 0.45

Tested by

no test coverage detected