What is the \"proper\" of writing the standard read-while loop in Scala? By proper I mean written in a Scala-like way as opposed to a Java-like way.
Here is the code I
Based on Rex's post that he mentioned:
Stream.continually(input.read(buffer)).takeWhile(_ != -1).foreach(md.update(buffer, 0, _))
You should replace the var readLen + while {...} lines with it, it produces the same result.
As Rex mentioned, it works with scala 2.8.