How to reproduce:
Take a file input stream and read it until it is exhausted. Then do setPosition(0) twice, and try to read again. It will fail with actual read size == 0. Problem is that line:
so that seeking is always performed if a setPosition has changed the read location.