What exactly do you mean by the camera "outputs a hex stream in the serial port"? Do you mean that the camera outputs a hex-ASCII stream (the ascii characters '0'-'9' and 'A'-'F') or do you mean it outputs a binary file? I suspect the answer is a binary file. If so, then just write the binary data to the file -- ...