On 1/13/06, Trustin Lee <[EMAIL PROTECTED]> wrote:
> 2006/1/11, Vinod Panicker <[EMAIL PROTECTED]>:
> > Hi,
> >
> > I'm considering making a compression filter that uses zlib and
> > possibly lzw for compressing data.
>
> Great idea.  I guess there should be a kind of latency untill the filter
> write the data actually to maximize the compression efficiency.  Extra
> complexity?

Actually if one looks at stream level compression, its different from
how "normal" compression works.  Normal compression would write a
header out first, and the the compressed data, and then the
terminator.

In stream compression, the header would be sent out only once, and the
application would be doing "partial flushes".

Now the Inflater and Deflater provided in the JDK do not (weirdly so)
expose the partial flush functionality.  The alternative then is to
use something like jzlib (http://jcraft.com/jzlib/index.html).

For network apps, the normal block compression wont make sense since
data might be fragmented when sent over a network.  There would need
to be some application protocol that specifies the start and end of a
compressed block.

Regarding the buffering, it would be a nice feature to have when
communication need not be real-time, but it could be added on later. 
For the first cut, I'm looking at basic stream compression.

Regards,
Vinod.

Reply via email to