Thanks but where you put "// your code here ", there's no actual code to put there. If I write it the way you suggest, the code checker still complains about an empty while statement.
Maybe that's the point, to simply clear all data from the stream. In this case, it most certainly is; the purpose is to calculate the SHA-1 digest.
I think what John meant is put a simple comment in the while loop that immediately explains exactly why you are doing nothing:
This always gets rid of the empty block warnings Eclipse is giving me, and it also tells anyone reading your code why the block is empty.
I understood that John meant to only place a comment in the while loop, but what I was saying is when I tried that, PMD, the code checker that is a plug-in for Eclipse, complained with the warning, "Avoid empty while statements", so even with the braces and the comment, it still considers the while statement empty.
So, the question remains, is there any way to rewrite that to achieve the same thing but satisfy the code checker?