I get \"IOException
: Stream Closed\" when I run this program. The text contains many lines of data. Program should read each line, do necessary functio
You close the input stream in your loop:
while ((inputLine = in.readLine()) != null) // error
// System.out.println(inputLine);
in.close();
You should close the stream outside of the loop:
while ((inputLine = in.readLine()) != null) // error
{
//dosomething
// System.out.println(inputLine);
}
in.close();