[fpc-pascal] GZip - Stream decompress only in memory

Marcos Douglas md at delfire.net
Sun Sep 4 21:46:03 CEST 2016


On Sun, Sep 4, 2016 at 4:29 PM, José Mejuto <joshyfun at gmail.com> wrote:
> El 04/09/2016 a las 19:17, Marcos Douglas escribió:
>
>>   try
>>     Buf.LoadFromFile('data.txt');
>>     showmessage(inttostr(ExtractStream(Buf, Buf2))); //<< result is 0, ie,
>> OK
>>     Buf2.SaveToFile('result.txt');
>
>
>> There is no error, but Buf2 is empty.
>
>
> Hello,

Hi,

> I'm not sure but I think that code at least should look like:
>
>   try
>     Buf.LoadFromFile('data.txt');
> --->>>>  Buf.Position:=0;
>     showmessage(inttostr(ExtractStream(Buf, Buf2)));
>     Buf2.SaveToFile('result.txt');
>
> Because I think the stream position is just at the end after LoadFromFile.

Nope, still the same, Buf2 is empty. :(

Marcos Douglas



More information about the fpc-pascal mailing list