Use the insert(int offset, String str) method of StringBuffer.
Are you using the Java API Docs? If you are serious about using Java, then you CANNOT make progress without them. They would have alerted you to the presence of this method, for instance.
Tim