uk.org.ogsadai.activity.transform
Class GZIPIncrementalProcessor

java.lang.Object
  |
  +--uk.org.ogsadai.activity.transform.GZIPIncrementalProcessor
All Implemented Interfaces:
IncrementalProcessor

public class GZIPIncrementalProcessor
extends java.lang.Object
implements IncrementalProcessor

An IncrementalProcessor that reads from an InputStream, compresses the data using GZIP compression, and writes to an OutputStream.

Author:
The OGSA-DAI Project Team

Constructor Summary
GZIPIncrementalProcessor(java.io.InputStream input, java.util.zip.Checksum checksum)
          Constructs an instance with the specified settings and default internal buffer size.
GZIPIncrementalProcessor(java.io.InputStream input, java.util.zip.Checksum checksum, int bufferSize)
          Constructs an instance with the specified settings.
 
Method Summary
 boolean active()
          Indicates whether or not processing is complete.
 void close()
          Closes the IncrementalProcessor, freeing up any resources.
 void initialise(java.io.OutputStream output)
          Initialises the instance to process to the specified output.
 void process()
          Performs some processing that may write data to the OutputStream> that the instance was initialised with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GZIPIncrementalProcessor

public GZIPIncrementalProcessor(java.io.InputStream input,
                                java.util.zip.Checksum checksum)
Constructs an instance with the specified settings and default internal buffer size.

Parameters:
input - The InputStream to read data from.
checksum - The Checksum object to use for the compression or null if no checksum is to be calculated.

GZIPIncrementalProcessor

public GZIPIncrementalProcessor(java.io.InputStream input,
                                java.util.zip.Checksum checksum,
                                int bufferSize)
Constructs an instance with the specified settings.

Parameters:
input - The InputStream to read data from.
checksum - The Checksum object to use for the compression or null if no checksum is to be calculated.
bufferSize - The size of the internal buffer used for each increment.
Method Detail

initialise

public void initialise(java.io.OutputStream output)
                throws java.io.IOException
Description copied from interface: IncrementalProcessor
Initialises the instance to process to the specified output.

Specified by:
initialise in interface IncrementalProcessor
Parameters:
output - the OutputStream
Throws:
java.io.IOException - if there is an I/O problem.

active

public boolean active()
Description copied from interface: IncrementalProcessor
Indicates whether or not processing is complete. If processing is not complete, then more processing can be performed by invoking the process method.

Specified by:
active in interface IncrementalProcessor
Returns:
true if processing is not complete, otherwise false.

process

public void process()
             throws java.io.IOException
Description copied from interface: IncrementalProcessor
Performs some processing that may write data to the OutputStream> that the instance was initialised with.

Specified by:
process in interface IncrementalProcessor
Throws:
java.io.IOException - If there is an I/O problem.

close

public void close()
           throws java.io.IOException
Description copied from interface: IncrementalProcessor
Closes the IncrementalProcessor, freeing up any resources.

Specified by:
close in interface IncrementalProcessor
Throws:
java.io.IOException - If there is an I/O problem.