I have the following code to read from a CSV:
InputStream inp = getClass().getResourceAsStream(filename);
InputStreamReader r = new InputStreamReader(inp);
BufferedReader reader = new BufferedReader(r);
On answered questions:
Java BufferedReader,
Convert InputStream to BufferedReader, What is the difference between Java's BufferedReader and InputStreamReader classes?
BufferedReader[BR] and InputStreamReader[ISR] both implement the same interfaces. BR has every method that ISR has with the additional methods including the ever so useful readLine() method and less useful but still relevant skip() method. You don't necessarily need BR to read single characters although BR can do the same more efficiently than ISR in this respect. The only significant difference is that FileReader is a subclass of ISR but not BR, although I have had sources on this website say that FileReader isn't really used anymore due to alternatives.
My research says that everything ISR can do is done better by BR. I am a young developer so every defined or imported class to me seems relevant. What I am trying to grasp is if some classes are no longer used, with new versions or frameworks replacing them. I want to know what more experienced developers have to say. SO, is there a reason to not use BR when using ISR?
QuickLinks to API:
BufferedReader
InputStreamReader