| 51 | namespace { |
| 52 | |
| 53 | Status ParseFromBufferImpl(const Buffer& buf, const std::string& full_name, |
| 54 | google::protobuf::Message* message) { |
| 55 | google::protobuf::io::ArrayInputStream buf_stream{buf.data(), |
| 56 | static_cast<int>(buf.size())}; |
| 57 | |
| 58 | if (message->ParseFromZeroCopyStream(&buf_stream)) { |
| 59 | return Status::OK(); |
| 60 | } |
| 61 | return Status::Invalid("ParseFromZeroCopyStream failed for ", full_name); |
| 62 | } |
| 63 | |
| 64 | } // namespace |
| 65 |
no test coverage detected