Delphi快速从文件流读取数据存入本地
var:
fs:TFileStream;
Path:string;
Buf4:array[0…3] of byte;
Str:string;
begin
fs := TFileStream.Create(Path+’*.map’, fmOpenRead or fmShareExclusive);
with fs do
begin
position:=0;
read(Buf4,4);
Str:=inttostr(Buf4[0]);
end;
fs.free;
with TStringList.Create do try
Add(Str);
SaveToFile(‘c:\temp.txt’);
finally
Free;
end;
end;