Package java.io
Class PrintWriter
Description:
This method flushes this stream.
Example
File file = new File("testFile");
String fileString = "Hello World";
OutputStream fos = new FileOutputStream(file);
PrintWriter pw = new PrintWriter(fos);
...
pw.flush();
The example above flushes the stream.