On Sun, Sep 4, 2016 at 1:37 PM, Ewald <ew...@yellowcouch.org> wrote: > On 04/09/16 18:08, Marcos Douglas wrote: >> Hi, >> >> I have streams compressed using GZip. I get these streams from WebServices. >> So, how can I decompress these streams only in memory? > > Perhaps have a look at zlibar. The main, and only, unit contains these > functions: > > function CompressStream(InStream: TStream; OutStream: TStream): Integer; > function ExtractStream(InStream: TStream; OutStream: TStream): Integer; > > I think this is what you are looking for. I don't know about file > headers. At least it would form a good starting point. > > Good luck!
Hi and thanks. I think you're talking about this lib, right? http://wiki.freepascal.org/Zlibar I installed and tried, but didn't work. See my code: === begin === procedure TMainForm.Button2Click(Sender: TObject); var Buf,Buf2: TMemoryStream; begin Buf := TMemoryStream.Create; Buf2 := TMemoryStream.Create; try Buf.LoadFromFile('data.txt'); showmessage(inttostr(ExtractStream(Buf, Buf2))); //<< result is 0, ie, OK Buf2.SaveToFile('result.txt'); finally Buf.Free; Buf2.Free; end; end; === end === There is no error, but Buf2 is empty. Regards, Marcos Douglas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal