Since this is trying to create a download manager that can stop and resume the download, the idea here is that when you resume, it wants to step back a bit and re-request some data that was sent earlier in the event of a shutdown due to an error that corrupted the received data. Most download managers that I have seen will fall back by at least 4 KB; it looks like it does only 1 kb.
If you put fs.Size only in the placeholder, then it will not back down at all, which may leave you open to the possibility of corrupted data.
And replacing TFileStream with TMemoryStream means that you are loading into RAM instead of a disk, and if the computer crashes or loses power, or something due to an application failure, all results will be lost. So this is not a good idea. In addition, loading into RAM limits the size of your download to the available size of your address space, which makes downloading large files (such as ISO DVDs) impossible or at least much more difficult than necessary.
source share