title: Decode a protocol buffer from raw bytes in C++
body: <p>I need to work with a protocol buffer input in my c++ function which is in raw bytes form. The tutorials in <a href="https://developers.google.com/protocol-buffers/docs/cpptutorial" rel="nofollow noreferrer">https://developers.google.com/protocol-buffers/docs/cpptutorial</a> only mention serializing and parsing data to/from files. This is not my use case. </p>
  
  <p>How can I decode a protocol buffer from raw bytes? I only have a pointer to the data and the size to work with. Preferably I don't want the data to be copied.</p>