Example widget: ZLib-compression and decompression

Example widget: ZLib-compression and decompression

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Example widget: ZLib-compression and decompression

Post by Auswaschbar »

Added example widget, which shows how to compress and decompress data using zlib in lua.

When it is useful: for sending chunks of data over the network, saving stuff to files
When it is not usefull: for small data chunks, minimum size for compression to be usefull is about 100 bytes for plain text

edit: does not work with 0.80.1, does work in master, will work in 0.80.1.1
Attachments
dbg_compress.lua
(1015 Bytes) Downloaded 29 times
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Example widget: ZLib-compression and decompression

Post by lurker »

I guess I was wrong about DEFLATE. It compresses blocks, not a stream. Are any compression methods easily available that use a streaming method? Can anyone find me a reference for zlib's streaming mode?
Post Reply

Return to “Lua Scripts”