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

Marcos Douglas md at delfire.net
Mon Sep 5 20:07:09 CEST 2016


On Sun, Sep 4, 2016 at 8:11 PM, Michalis Kamburelis
<michalis.kambi at gmail.com> wrote:
> It seems you already have a solution, but here's another one:)
>
> In Castle Game Engine, I have a unit CastleZStream that provides
> TGZFileStream that can compress/decompress in memory. It uses the
> CastleGzioInternal unit, which is a modified version of Gzio unit from
> FPC, modified to be able to work with TStream (not just a file). You
> can take these two files to have it working:
>
> https://github.com/castle-engine/castle-engine/blob/master/src/base/castlegziointernal.pas
> https://github.com/castle-engine/castle-engine/blob/master/src/base/castlezstream.pas

Looks good, thank you!

> For base64, the TBase64EncodingStream and TBase64DecodingStream from
> standard FPC Base64 unit do the job nicely:)

I didn't know that FPC had classes for Base64. Well, I didn't search
because I've always used Synapse::synacode.
Thanks for this tip.

> They all (TBase64EncodingStream, TBase64DecodingStream, TGZFileStream)
> descend from TOwnerStream which is a common useful class for a stream
> that processes another stream.

I also didn't know TOwnerStream.  Thanks.

Regards,
Marcos Douglas



More information about the fpc-pascal mailing list