<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type></HEAD>
<BODY>
<DIV>
<DIV style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">I have converted the one from fpc to its own library to do streams , can email it to you later if you wish</DIV></DIV>
<DIV dir=ltr>
<HR>
<SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">From: </SPAN><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif"><A href="mailto:michalis.kambi@gmail.com">Michalis Kamburelis</A></SPAN><BR><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">Sent: </SPAN><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">28/03/2013 6:13 AM</SPAN><BR><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">To: </SPAN><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif"><A href="mailto:fpc-pascal@lists.freepascal.org">FPC-Pascal users discussions</A></SPAN><BR><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">Subject: </SPAN><SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">Re: [fpc-pascal] TStream descendant to compress/decompress gzip data from another stream</SPAN><BR><BR></DIV>José Mejuto wrote:<BR>> El 27/03/2013 19:22, Michalis Kamburelis escribió:<BR>><BR>>> Google found an old thread on lazarus mailing list about this ("FPC,<BR>>> gzip and stream") but without any solution, everything mentioned there<BR>>> has either the limitations of TCompressionStream/TDecompressionStream<BR>>> (no gzip format) or TGZFileStream (not able to work wit ObjectPascal<BR>>> streams).<BR>>><BR>><BR>> Hello,<BR>><BR>> .gz is a quite simple format, but it can not be implemented as a TStream<BR>> (only) descendant because in a single .gz file many files could be added<BR>> so something like the class to handle .zip files should be used.<BR><BR>The existing TGZFileStream in ZStream unit already shows that it can be <BR>implemented, i.e. TGZFileStream reads gzip data and is a TStream <BR>descendant. I assume that TGZFileStream simply returns the first file <BR>inside a multi-file gzip (otherwise it would need to call gzopen <BR>multiple times, as far as I understand).<BR><BR>This is also my use case: I know that my .gz files should contain only <BR>one file (X3D standard guarantees it for me), I want to ignore the <BR>remaining files (if any).<BR><BR>><BR>> Parsing the .gz header is easy, and calling TCompressionStream and<BR>> TDecompressionstream over the payload should be easy, but only for the<BR>> first file in the .gz<BR>><BR><BR>I will probably have to implement it then. I was hoping to have <BR>something available ready, since ZStream contains things that are *so* <BR>close (but not quite) to what I want :)<BR><BR>Thanks,<BR>Michalis<BR>_______________________________________________<BR>fpc-pascal maillist - fpc-pascal@lists.freepascal.org<BR>http://lists.freepascal.org/mailman/listinfo/fpc-pascal<BR></BODY></HTML>