Estou com uma dúvida nesse flush() alguém pode me explicar?
package br.com.aprendendo.javacore.Vio.test;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class BufferWriterTeste {
public static void main(String[] args) {
File file = new File("file.txt");
try (FileWriter fileWriter = new FileWriter(file);
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter)) {
bufferedWriter.write("O salndo no arquio...");
bufferedWriter.newLine();
bufferedWriter.flush();
} catch (IOException e) {
// TODO: handle exception
}
}
}