You are not logged in.
Pages: 1
when the Source is a TMemoryStream, TAlgoCompress.StreamCompress will always read the first 4M bytes, you never advance S to next chunk.
A.TXT with 'A' and 'B',
run the sample project, then check the B.TXT, you will find only 'A' is appear.
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
Classes,
mormot.core.buffers;
const
ChunkComp_Magic:Cardinal = $4E50435A;
ChunkComp_ChunkSize = 4096;
var
ms:TMemoryStream;
begin
ms:=TMemoryStream.Create;
ms.LoadFromFile('A.TXT');
AlgoSynLZ.StreamCompress(ms,'A.SLZ',ChunkComp_Magic,False,False,ChunkComp_ChunkSize);
ms.Free;
ms := AlgoSynLZ.StreamUnCompress('A.SLZ',ChunkComp_Magic,False);
ms.SaveToFile('B.TXT');
ms.Free;
end.
Last edited by MyKore (2022-07-08 13:13:27)
Offline
Please follow the forum rules and do not post huge code or text in the forum.
Didn't https://github.com/synopse/mORMot2/commit/585a9758913 fix it?
Offline
my sample project is successful now.
by the way, what's the mean of {%H-},
e.g.: D = pointer({%H-}tmpd)
Last edited by MyKore (2022-07-09 12:19:26)
Offline
Pages: 1