var
fs: TFileStream;
inBuf,outBuf: PChar;
offset,inSize,outSize: Integer;
begin
{buffers are allocated, necessary offsets and sizes are set}
{ lets create file }
fs := TFileStream.Create(test.dat,fmCreate);
{ write some data}
fs.WriteBuffer(outBuf^,outSize);
{ seek to needed position }
fs.Seek(offset, soFromBeginning);
{ read some data }
fs.ReadBuffer(inBuf^,inSize);
{close file }
fs.Free;
end; |
var
fs: TECLFileStream;
inBuf,outBuf: PChar;
offset,inSize,outSize: Integer;
begin
{buffers are allocated, necessary offsets and sizes are set}
{ lets create compressed and encrypted file}
fs := TECLFileStream.Create(test.dat, fmCreate, Password, eclFastest);
{ write some data }
fs.WriteBuffer(outBuf^,outSize);
{ seek to needed position }
fs.Seek(offset, soFromBeginning);
{ read some data }
fs.ReadBuffer(inBuf^,inSize);
{close file }
fs.Free;
end; |