guard agaist hitting message boundaries at the end of a file chunk, or extra bytes at the end of a file