remove an static cast in java IO Test

nRead used to be a long int, so there was a static cast (int) nRead. Now this static cast is removed.