I am using java InputStreamReader read (). When I get to the end of the input stream, I have to enter -1 into my int variable, but instead it goes into a block. Why am I not getting -1 at the end of the input stream? (I debugged this letter by letter, making sure that this is really the end of the input and that the connection connector is alive).
Uses the ready () function - a good solution, making:
if (isr.ready()) currCharVal = isr.read();
Thanks in advance, Guy.
source share