Basically I would like to know whether or not the PrintWriter is a Buffered Writer.
I have seen code like PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(file)));
However from this javadoc:
Parameters: file - The file to use as the destination of this writer. If the file exists then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.
Bottom line: I think that PrintWriter is buffered since the javadoc "kind of mention it" (see the quote) and if I don't flush a PrintWriter it does not get printed.
Do you confirm my thesis? In that case why there is some code that goes like:
PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(file)));
legacy code?
Thanks in advance.