The Java I/O API has top-level objects- Reader and Writer which both have some useful methods to inherited classes like BufferedReader or BufferedWriter.
From the
Java I/O Streams-
Some other notable methods in the top-level classes include skip(int), mark(int), reset(), available(), ready() and flush(), these are described below...
...The flush() method simply writes out any buffered characters (or bytes) to the destination (for example, file, or socket).
Closing any type of I/O stream (file or socket) is a good habit to follow for several reasons- freeing up system resources, freeing up the heap for other objects, preventing file locks for other applications or for multi-threaded applications and so many more reasons.