My code is as follows:
myBuffer = myInput.read()
if (!myBuffer.!=(-1)) {
return -1
}
myBuffer
is declared as a var int at the top of the class and I am trying to check when it equals -1 so that I can return -1. When I tried doing it the Java way, like so:
if ( (myBuffer = myInput.read()) == -1) {
return -1;
}
I got an warning saying that a test for equality with Unit will always give false, which was verified when I ran it and it never exited the loop that this code was a part of. This feels like it should be trivial but I haven't been able to find a solution to this. Any ideas?