Does this program compile correctly?
And after fixing the code, i commented all the 8 lines (input.read()) and it worked exactly similar as it worked before. I didn't find any problem.