You will have to see if there are byte order issues.
I would tend to do some integrity checks too -- checksum for example, and checking that if you go forward to the end of the message you get to the header of the next one (that is how I personally would progress through the data stream rather than match pattern; using match pattern to realign if data was lost/corrupted and I had to find the next good message).
But you are on the right track.
Batya