RE: TStream descendant to compress/decompress gzip data from another stream

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: TStream descendant to compress/decompress gzip data from another stream

Justin Smyth-2
I have converted the one from fpc to its own library to do streams , can email it to you later if you wish

From: [hidden email]
Sent: ‎28/‎03/‎2013 6:13 AM
To: [hidden email]
Subject: Re: [fpc-pascal] TStream descendant to compress/decompress gzip data from another stream

José Mejuto wrote:

> El 27/03/2013 19:22, Michalis Kamburelis escribió:
>
>> Google found an old thread on lazarus mailing list about this ("FPC,
>> gzip and stream") but without any solution, everything mentioned there
>> has either the limitations of TCompressionStream/TDecompressionStream
>> (no gzip format) or TGZFileStream (not able to work wit ObjectPascal
>> streams).
>>
>
> Hello,
>
> .gz is a quite simple format, but it can not be implemented as a TStream
> (only) descendant because in a single .gz file many files could be added
> so something like the class to handle .zip files should be used.

The existing TGZFileStream in ZStream unit already shows that it can be
implemented, i.e. TGZFileStream reads gzip data and is a TStream
descendant. I assume that TGZFileStream simply returns the first file
inside a multi-file gzip (otherwise it would need to call gzopen
multiple times, as far as I understand).

This is also my use case: I know that my .gz files should contain only
one file (X3D standard guarantees it for me), I want to ignore the
remaining files (if any).

>
> Parsing the .gz header is easy, and calling TCompressionStream and
> TDecompressionstream over the payload should be easy, but only for the
> first file in the .gz
>

I will probably have to implement it then. I was hoping to have
something available ready, since ZStream contains things that are *so*
close (but not quite) to what I want :)

Thanks,
Michalis
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TStream descendant to compress/decompress gzip data from another stream

Michalis Kamburelis-3
Justin Smyth wrote:
> I have converted the one from fpc to its own library to do streams , can
> email it to you later if you wish

Yes, that would be appreciated. As long as everything you send me is
covered by the same license as FPC RTL (LGPL with static linking
exception), so that I can use it in my own code and also contribute it
back to FPC :)

Michalis
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TStream descendant to compress/decompress gzip datafrom another stream

Justin Smyth
I will send it later today. i have to find the code and its at work , but i
think i have a copy here somewhere... dont need to worry about the license
as its just a extraction of one of the units from FPC that needed a few
small changes

-----Original Message-----
From: Michalis Kamburelis
Sent: Thursday, March 28, 2013 9:16 AM
To: FPC-Pascal users discussions
Subject: Re: [fpc-pascal] TStream descendant to compress/decompress gzip
datafrom another stream

Justin Smyth wrote:
> I have converted the one from fpc to its own library to do streams , can
> email it to you later if you wish

Yes, that would be appreciated. As long as everything you send me is
covered by the same license as FPC RTL (LGPL with static linking
exception), so that I can use it in my own code and also contribute it
back to FPC :)

Michalis
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal 


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal