Blockread(file pointer, buffer, max size, var BytesRead)

There is no need for calculating the size, you got them from paramter BytesRead.

Regards
Thomas