UnCompress Buffer

delphi package - madRes, madTools, madStrings, ...
Post Reply
Armagedon
Posts: 14
Joined: Tue May 27, 2008 4:30 am

UnCompress Buffer

Post by Armagedon »

hi
how i can uncompress , Compressed file from buff to mem and extract to harddisk?

i need an example
thanks ;
madshi
Site Admin
Posts: 10339
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Something like this (not tested):

Code: Select all

procedure Whatever(compressedDataStr: AnsiString);
var uncompr : AnsiString;
begin
  uncompr := Uncompress(compressedDataStr);
  with TFileStream.Create(...) do begin
    WriteBuffer(PAnsiChar(uncompr)^, Length(uncompr));
    Free;
  end;
end;
Post Reply