I need to modify specific contents of a file in-place. I do not want to create a new file and rewrite the old. Also the files are small
Java supports random file access, in particular using seek().
seek()
Have a look at: http://docs.oracle.com/javase/tutorial/essential/io/rafs.html