rabbit.zip
Class GZipPacker

java.lang.Object
  extended by rabbit.zip.GZipPacker

public class GZipPacker
extends Object

A class that can pack gzip streams in chunked mode.

Author:
Robert Olofsson

Constructor Summary
GZipPacker(GZipPackListener listener)
          Create a gzip packer that sends events to the given listener.
 
Method Summary
 void finish()
          Tell the packer that it has reached the end of data.
 boolean finished()
          Check if the packer is finished.
 void handleCurrentData()
          Handle the next block of the current data.
 boolean needsInput()
          Check if the unpacker currently needs more data
 void setInput(byte[] buf, int off, int len)
          Add more compressed data to the unpacker.
 void setState(rabbit.zip.GZipPackState state)
          Change the internal gzip state to the given state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GZipPacker

public GZipPacker(GZipPackListener listener)
Create a gzip packer that sends events to the given listener.

Parameters:
listener - the listener that will be notifiec when data has been packed.
Method Detail

needsInput

public boolean needsInput()
Check if the unpacker currently needs more data

Returns:
true if more input data is currently needed

setInput

public void setInput(byte[] buf,
                     int off,
                     int len)
Add more compressed data to the unpacker.

Parameters:
buf - the array holding the new data
off - the start offset of the data to use
len - the length of the data

finish

public void finish()
Tell the packer that it has reached the end of data.


finished

public boolean finished()
Check if the packer is finished.

Returns:
true if packing has finished

handleCurrentData

public void handleCurrentData()
Handle the next block of the current data.


setState

public void setState(rabbit.zip.GZipPackState state)
Change the internal gzip state to the given state.

Parameters:
state - the new internal state of the gzip packer.