Sign in Join

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

Mailing lists / lazarus / 2012-02

FPC, gzip and stream

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

silvioprog

Hello,

How to use gzip in stream with FPC?

Only deflate:

(...)
  var
    S: string;
    VDeflate: TCompressionStream;
  begin
    VDeflate := TCompressionStream.Create(clMax, Contents);
    try
      S := 'Hello';
      VDeflate.Write(Pointer(S)^, Length(S));
    finally
      VDeflate.Free;
    end;
  end;
(...)

But, with gzip, without sucess. :(

Exists an 'TGZCompressionStream'?

Thanks!

ps. See: http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression

Silvio Cl?cio ==================================== Site - <silvioprog.com.br> LazSolutions - <code.google.com/p/lazsolutions> ====================================

Reply by email

Darius Blaszyk
to silvioprog

There's a gzip example program in packages/paszlib/examples

Darius

silvioprog wrote 41 lines
Hello, How to use gzip in stream with FPC? Only deflate: (...) var S: string; VDeflate: TCompressionStream; begin VDeflate := TCompressionStream.Create(clMax, Contents); try S := 'Hello'; VDeflate.Write(Pointer(S)^, Length(S)); finally VDeflate.Free; end; end; (...) But, with gzip, without sucess. :( Exists an 'TGZCompressionStream'? Thanks! ps. See: http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression -- Silvio Cl?cio ==================================== Site - <silvioprog.com.br> LazSolutions - <code.google.com/p/lazsolutions> ==================================== -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Unknown author
to silvioprog: How to use gzip in stream with FPC? Only deflate: (...) var S: string; VDeflate:…

You free the object before use the compressed stream.

Enviado desde mi BlackBerry? de Claro Argentina

Earlier message 44 lines
-----Original Message----- From: silvioprog Date: Sat, 4 Feb 2012 00:02:47 To: Lazarus mailing list Reply-To: Lazarus mailing list Subject: [Lazarus] FPC, gzip and stream Hello, How to use gzip in stream with FPC? Only deflate: (...) var S: string; VDeflate: TCompressionStream; begin VDeflate := TCompressionStream.Create(clMax, Contents); try S := 'Hello'; VDeflate.Write(Pointer(S)^, Length(S)); finally VDeflate.Free; end; end; (...) But, with gzip, without sucess. :( Exists an 'TGZCompressionStream'? Thanks! ps. See: http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression -- Silvio Cl?cio ==================================== Site - <silvioprog.com.br> LazSolutions - <code.google.com/p/lazsolutions> ==================================== --

Reply by email

Graeme Geldenhuys
to silvioprog: How to use gzip in stream with FPC? Only deflate: (...) var S: string; VDeflate:…
silvioprog wrote
How to use gzip in stream with FPC?

See tiOPF v2, and units dzlib.pas and tiCompressZLib.pas in the Options directory.
I use it in production code, and the tiOPF code is very well unit tested too.

tiOPF is hosted on SourceForge at:

http://sourceforge.net/projects/tiopf/

A direct link to the Options directory.

http://tiopf.svn.sourceforge.net/viewvc/tiopf/tiOPF2/Trunk/Options/

You can use the dzlib.pas unit directly, but the tiComplessZLib unit gives a much easier interface to zlib compression and decompression.

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

silvioprog
to Unknown author

2012/2/6 :
[...]

The zstream unit contains the TGZFileStream class which can be used to read or write GZIp files. Michael.

Hello Michael. :)

Hm, I noticed, but you can work directly with stream without necessarily having to create a file?

Silvio Cl?cio ==================================== Site - <silvioprog.com.br> LazSolutions - <code.google.com/p/lazsolutions> ====================================

Reply by email