First, InputStreamReader
can handle all input streams, not just files. Other examples are network connections, classpath resources and ZIP files.
Second, FileReader
until Java 11 did not allow you to specify an encoding and instead only used the plaform default encoding, which made it pretty much useless as using it would result in corrupted data when the code is run on systems with different platform default encodings.
Since Java 11, FileReader
is a useful shortcut for wrapping an InputStreamReader
around a FileInputStream
.