I have an isapi DLL (made in Delphi) that must return large files (video files). All theses video files are concatenated in one single physical file (data file). So for example if an user request the file #123 then the isapi dll will need to return the bytes in the data file located from offset $xx to offset $yy.
Actually my problem is that it's look like I load in memory all the bytes from offset $xx to offset $yy when i send them via EXTENSION_CONTROL_BLOCK WriteClient
Is their a way to not load in memory all the bytes and return it incrementally as the user client request it ?
actually this is my code :
var Buffer: array[0..8191] of Byte;
AStream.Position := StartOffset;
while AStream.Position < EndOffset do begin
BytesToSend := AFileStream.Read(Buffer, SizeOf(Buffer));
MyEXTENSION_CONTROL_BLOCK.WriteClient(ECB.ConnID, @Buffer, DWORD(BytesToSend)
end