Sign in Join

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

Mailing lists / fpc-pascal / 2017-05

Network compression

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Dimitrios Chr. Ioannidis

Hi,

I need to transfer data which are relative big ( 1,2 GB )using low memory ( 512MB, 1GB RAM ) machines.

I was thinking something like load partial the file I ie.e a 64K memory block ) compress it send that compressed block via network and at the other end receive that block decompressed it and write it to disk, "repeat until done" .

I've searched but I didn't find any example on how to compress / decompress in blocks .

Any hints ?

regards,

Dimitrios Chr. Ioannidis
Graeme Geldenhuys
to Dimitrios Chr. Ioannidis
Dimitrios Chr. Ioannidis wrote
I've searched but I didn't find any example on how to compress / decompress in blocks .

Take a look at how it is done in tiOPF. The unit is pretty stand-alone, so you don’t need to use the rest of tiOPF to make use of this unit.

https://sourceforge.net/p/tiopf/code/ci/tiopf2/tree/Options/tiCompressZLib.pas

The code should be self explanatory. There is even a tiCompressNone.pas which is great for testing purposes.

If you still don’t know how to use the unit, take a look at the unit tests, in the “UnitTests” directory, for detailed usage examples.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp