This is an empty loop; nothing is done when reading the value. In fact, you can completely get rid of the variable b :
while (din.read() != -1) { }
I also replaced the semicolon (empty statement) with an empty block, as this is a bit more detailed on what is going on here.
This is a very atypical way of reading from the input stream (usually you want to do something with the data that has been read), since the digest input stream has a side effect: if you read it, it also calculates the hash of everything that is read. If you only need a hash, you need to read, but you don't need to do anything with the values ββthat are read.
source share