Are FileChannel.force and FileDescriptor.sync both needed?

In https://stackoverflow.com/questions/730521/really-force-file-sync-flush-in-java, the author writes in the summary of the answers:

Use c.force(true) followed by s.getFD().sync() for Java NIO

My question is: do you really need both? Isn't force enough? Aren't force and sync just different interfaces for doing the same thing? I can't find anyplace where this is confirmed.

9
задан Community 23 May 2017 в 11:44
поделиться