Have the terminator be a unique sequence of characters and also have a header which includes the payload size maybe is simplest thing I can think of
What about generating random 1 byte binary for each archieve and using that as terminator?