I use the JCL wrapper to compress a GZIP stream - not sure if it would work simply using a TJcl7ziCompresspArchive. To compress a stream I use the following:
procedure _CompressStreamGZIP( const ASourceStream, ADestinationStream: TStream );
var
LArchive : TJclCompressArchive;
begin
ADestinationStream.Position := 0;
ASourceStream.Position := 0;
LArchive := TJclGZipCompressArchive.Create( ADestinationStream, 0, False );
try
LArchive.AddFile( '..\Stream.0', ASourceStream, false );
LArchive.Compress();
finally
if ( Assigned( LArchive ) ) then FreeAndNil( LArchive );
end;
end;
To decompress the stream:
procedure _DecompressStreamGZIP( const ASourceStream, ADestinationStream : TStream );
var
LArchive : TJclDecompressArchive;
begin
ADestinationStream.Position := 0;
ASourceStream.Position := 0;
LArchive := TJclGZipDecompressArchive.Create( ASourceStream, 0, false );
try
LArchive.ListFiles();
LArchive.Items[0].Stream := ADestinationStream;
LArchive.Items[0].OwnsStream := false;
LArchive.Items[0].Selected := True;
LArchive.ExtractSelected();
finally
if ( Assigned( LArchive ) ) then FreeAndNil( LArchive );
end;
end;