This is an OS question.
Generally, when you overwrite a file, it is the same as deleting the previous file and writing a new one. In any case, this is not something that will be unique to Java - Java will just be making OS calls to write the data to disk.
I don't know of any OS that wouldn't just allocate more space for you.