Use FileChannelWriter behind AtomicFileWriter
@@ -35,6 +35,7 @@ import java.nio.file.Files;
import java.nio.file.InvalidPathException;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
+import java.nio.file.StandardOpenOption;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -116,7 +117,7 @@ public class AtomicFileWriter extends Writer {
throw new IOException("Failed to create a temporary file in "+ dir,e);
}
- core = Files.newBufferedWriter(tmpPath, charset);
+ core = new FileChannelWriter(tmpPath, charset, StandardOpenOption.WRITE);
}
@Override
