We all know that it is a good habit to close all the StreamReaders we have defined at the end of code.
Now we can see that two Readers was defined as below. BufferedReader and InputStreamReader.The BufferedReader was closed, but we are unable to close the InputStreamReader.
JAVA code:
BufferedReader in = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
if (in != null) {
in.close();
}
The problem is here, if the InputStreamReader in the parentheses should be closed? Will this kind of code bring some problem to the program? Please tell me , thank you~