I think you're asking if Java has an equivalent to C's fflush and fsync. There are no methods called either fflush or fsync in Java. But if you're using a Writer or a Stream (e.g. a FileWriter or FileOutputStream) then
you should call flush() to ensure that everything in the buffers has been written to disk. Calling close() also accomplishes this (so you really only need flush() if you want to keep the stream open afterwards for some reason). For writers and outputstreams, there is no need for fsync or any equivalent; it's all handled by flush() or close(). If you're using a RandomAccessFile you need to call close() at the end to achieve the effect of a fflush and fsync, and if you're using a FileChannel you can call either close() or force() - the latter allows the channel to remain open, like flush(). For other classes, just look at the API and see what options they offer. Some sort of close() operation is most common in Java.