Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-03

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

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Justin Smyth

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

Earlier message 44 lines
-----Original Message----- From: "Michalis Kamburelis" Sent: ‎28/‎03/‎2013 6:13 AM To: "FPC-Pascal users discussions" 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

Reply by email

Michalis Kamburelis
to Justin Smyth
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

Reply by email

Justin Smyth
to Michalis Kamburelis

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

Earlier message 17 lines
-----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

Reply by email