this is a code snippet taken from https://forums.embarcadero.com/message.jspa?messageID=219481
if FileExists(dstFile) then
begin
Fs := TFileStream.Create(dstFile, fmOpenReadWrite);
try
Fs.Seek(Max(0, Fs.Size-1024), soFromBeginning);
// alternatively:
// Fs.Seek(-1024, soFromEnd);
Http.Request.Range := IntToStr(Fs.Position) + '-';
Http.Get(Url, Fs);
finally
Fs.Free;
end;
end;
i do not understand what exactly is off-set and why Max(0,Fs.Size-1024) in its placeholder and if you go below(in code)
// alternatively:
// Fs.Seek(-1024, soFromEnd);
what exactly is '-1024'...why do the always use 1024/-1024?? and would fs.size alone in the offset paceholder work( i am tring to make a download manage with pause resume support) and would replacing tfilestream with tmemmorystream in code above have any effect on program?
if it matters :i use d2007 and d2010