You're given a DataHeader struct that represents a package comprised of two sets of bytes, a DataView that can be seen as a non-owning container of some data and a copyViewData function that copies the contents of a DataView to a buffer.
You also get a validateHeader function which determines whether a DataHeader is valid. Depending on the product variant, the function has different implementations but the signature always remains the same.
Your goal is to create a parseData function which receives two DataView objects, copies them into a DataHeader object and validates the DataHeader object. The DataView objects may be empty, which depending on the project can be fine. The validateHeader function will simply return false if the given header is not as expected.
Assuming no other constraints, which of the two parseData versions would you prefer and why?