Took me a little to make sense of this line, because up until line 109 I was assuming that the value of `size` didn't change. Maybe introduce a new variable, say `remainder` or `leftToRead` initialized with `size`, so it is easier to understand the algorithm?