Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
public void flush()
IOException thrown if an input/output (I/O) error occurs.