FileInputStream vs FileReader

Yes, your conclusion is correct subclasses of Reader and Writer are for reading/writing text content. InputStream / OutputStream are for binary content. If you take a look at the documentation: Reader – Abstract class for reading character streams InputStream – Abstract class is the superclass of all classes representing an input stream of bytes.

Is it necessary to close each nested OutputStream and Writer separately?

Assuming all the streams get created okay, yes, just closing bw is fine with those stream implementations; but that’s a big assumption. I’d use try-with-resources (tutorial) so that any issues constructing the subsequent streams that throw exceptions don’t leave the previous streams hanging, and so you don’t have to rely on the stream implementation having … Read more