please explain this logic

its from this solution . can someone please explain part after “if we reached end of buffer” ?

getting confused at

                           // and now fil the buffer

			inp.read(buff, j, size - j);