[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Data Compression



On Mon, 31 Jan 2000, Jerome Kaidor wrote:

>    When you use a compressor like gzip, you tell it:
> 
>   "Here is a file, or data area for you to compress.  Here's where it
> starts, here's how long it is.  Put the compressed version over there.  Come
> back when you're through."
> 
>    Whereas with my compressor, you'd say:
> 
>    "I want you to start creating some compressed data for me."
>              ( compressor returns a 'handle' for use in subsequent calls )
>    "Here's a kilobyte"
>    "Here's five hundred thirty  three more bytes"
>    "Here's another byte"
>    "Here's another hundred bytes"
>              .
>              .
>              .   
>    "OK, there's no more bytes.  Finish it up!"

Actually, the zlib library that (as far as I know) forms the basis for
gzip does just that.

There are functions like gzread(), gzwrite(), gzprintf() and gzgets()
that are equivalent to the corresponding system functions. When reading,
it automatically detects whether the input is compressed, so you can use
these functions to read both compressed and uncompressed data. See
/usr/include/zlib.h on your Linux box for more info.

Groeten,				- Jacco

--
Think about it:               | In Real Life: Jacco van Schaik
If the wheel had never been   | Mail me at:   jacco@nlr.nl
reinvented, we'd still be     | Spam bait:    postmaster@localhost
driving on logs...            | See also http://www.nlr.nl/NARSIM.html

-
Archives of linux-aviation: http://mail.nl.linux.org/lists/linux-aviation/
To unsubscribe: send the command "unsubscribe linux-aviation" in the body
of a mail message to <Majordomo@mail.nl.linux.org>.