package rabbit.zip;

/** A class that can pack gzip streams in chunked mode.
 *
 * @author <a href="mailto:robo@khelekore.org">Robert Olofsson</a>
 */
public class GZipPacker {
    private GZipPackState state;
    
    /** Create a gzip packer that sends events to the given listener. 
     * @param listener the listener that will be notifiec when data has
     *        been packed.
     */
    public GZipPacker (GZipPackListener listener) {
	state = new HeaderWriter (listener);
    }

    /** Check if the unpacker currently needs more data 
     */
    public boolean needsInput () {
	return state.needsInput ();
    }

    /** Add more compressed data to the unpacker.
     */
    public void setInput (byte[] buf, int off, int len) {
	state.handleBuffer (this, buf, off, len);
    }

    /** Tell the packer that it has reached the end of data.
     */ 
    public void finish () {
	state.finish ();
    }

    /** Check if the packer is finished.
     */ 
    public boolean finished () {
	return state.finished ();
    }

    /** Handle the next block of the current data. 
     */
    public void handleCurrentData () {
	state.handleCurrentData (this);
    }

    /** Change the internal gzip state to the given state.
     * @param state the new internal state of the gzip packer.
     */ 
    public void setState (GZipPackState state) {
	this.state = state;
    }
}

@@ -540,24 +540,83 @@
 e data %0A
+     * @return true if more input data is currently needed%0A
      */%0A
     publ
@@ -599,32 +599,32 @@
  needed%0A     */%0A
-
     public boole
@@ -724,24 +724,168 @@
 e unpacker.%0A
+     * @param buf the array holding the new data%0A     * @param off the start offset of the data to use%0A     * @param len the length of the data%0A
      */%0A    
@@ -1103,32 +1103,32 @@
 nish ();%0A    %7D%0A%0A
-
     /** Check if
@@ -1148,24 +1148,68 @@
 s finished.%0A
+     * @return true if packing has finished%0A
      */ %0A   

Add some javadoc.