Something in java like
int a = 1, b = 2, c = 1;
if ((a = b) !=c){
System.out.print(true);
}
now it should be converted to kotlin like<
(a = b) != cb.also { a = it } != cAround OP's question:
Unlike the accepted answer, I recommend using Kotlin's also function, instead of let:
while (input.read(bytes).also { tmp = it } != -1) { ...
Because T.also returns T (it) itself and then you can compare it with -1. This is more similar to Java's assignment as an expression.
See "Return this vs. other type" section on this useful blog for details.