Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

fast-lzma2-delphi

fast-lzma2.h conversion to delphi

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

fast-lzma2-delphi

fast-lzma2.h conversion to delphi. It's not completed yet. Let me know if you can contribute with the conversion too. You need fast-lzma2.dll to use this.

A simple example:

var

ms: tmemorystream;

outbuff: pointer;

outsize: integer;

outa: TFileStream;

begin

try

ms := tmemorystream.Create;

ms.LoadFromFile(Paramstr(1)); {Loading file to memory}

getmem(outbuff, ms.Size + 14); {Getting required memory to buffer}

outsize:=FL2_compressmt(outbuff,ms.Size+14,ms.Memory,ms.Size,9); {Compressing using fast lzma2}

outa:=TFilestream.Create(Paramstr(2), fmCreate);

outa.Writebuffer(outbuff^, outsize); {Writting to output}

outa.free;

ms.Free;

except

pascal
on E: Exception do
pascal
Writeln(ErrOutput,E.ClassName + ': ' + E.Message);

end;

end.