You are not logged in.
Pages: 1
my sample project is successful now.
by the way, what's the mean of {%H-},
e.g.: D = pointer({%H-}tmpd)
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.
Pages: 1