There are methods to rewrite only the portion after the insertion point, but generally, no - to insert something at a particular point in a file, you must re-write everything after that point.
This boils down to the way files are stored on disk - typically in chunks, such that this operation is either not possible or not easy. For 99% of the cases, this doesn't matter, so the API doesn't expose a way of doing this.
If you have control over the file format, you can engineer ways such that you can write data to the end of the file, but have some tracking data to say "this stuff really belongs here".
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…