You could more easily just allocate space for the worst case, based on the length of the message, and if a couple of your fragments are a byte shorter than others, that's fine. - Ian