com.izforge.izpress
Class Compressor

java.lang.Object
  extended bycom.izforge.izpress.Compressor

public class Compressor
extends java.lang.Object

Compressor is the class used to compress the size of a (valid !) HTML code.

To use it, first create an instance of Compressor and give the constructor an input stream and an output stream. Then call compress() that will send to the output stream the compressed HTML code.

Version:
1.1
Author:
Julien Ponge

Constructor Summary
Compressor(java.io.InputStream in, java.io.OutputStream out, CompressorConfig cfg)
          The constructor.
 
Method Summary
 void addListener(CompressorListener l)
          Adds a listener.
 void compress()
          Lauches the compression and sends the compressed HTML code to the output stream given in the constructor.
protected  void finalize()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Compressor

public Compressor(java.io.InputStream in,
                  java.io.OutputStream out,
                  CompressorConfig cfg)
           throws java.io.IOException
The constructor.

Parameters:
in - The input stream <=> uncompressed HTML code.
out - The output stream <=> compressed HTML code.
cfg - Tells the compressor what it must do.
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

addListener

public void addListener(CompressorListener l)
Adds a listener.

Parameters:
l - The CompressorListener.
See Also:
CompressorListener, CompressorEvent

compress

public void compress()
              throws java.io.IOException
Lauches the compression and sends the compressed HTML code to the output stream given in the constructor.

Throws:
java.io.IOException