title: Using flush() before close()
body: <p>As per the java docs, invoking close() on any java.io Streams automatically invokes flush(). But I have seen in lot of examples, even in production codes, developers have explicitly  used  flush() just before close(). In what conditions we need to use flush() just before close()?</p>