sam.io
Class StreamFilter

java.lang.Object
  |
  +--sam.io.StreamFilter
Direct Known Subclasses:
Packer

public abstract class StreamFilter
extends java.lang.Object

Generic type for I/O stream filters.

A stream filter is the association of mechanism for filtering an InputStream- and the corresponding de-filtering of an OutputStream.

Typical implementations are compressor like Zip or Huffman.


Constructor Summary
StreamFilter()
           
 
Method Summary
abstract  java.io.InputStream filterInput(java.io.InputStream input)
          Filters (decompress) the archive input.
abstract  java.io.OutputStream filterOutput(java.io.OutputStream output)
          Filters (compress) the archive output.
 void finishFilter(java.io.OutputStream output)
          Finishes the archive output filtering.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamFilter

public StreamFilter()
Method Detail

filterInput

public abstract java.io.InputStream filterInput(java.io.InputStream input)
                                         throws java.io.IOException
Filters (decompress) the archive input.

Parameters:
input - the archive input.
Returns:
a filtered stream from which plain data can be read.
java.io.IOException

filterOutput

public abstract java.io.OutputStream filterOutput(java.io.OutputStream output)
                                           throws java.io.IOException
Filters (compress) the archive output.

Parameters:
output - the archive output.
Returns:
a filtered stream to which plain data can be written.
java.io.IOException

finishFilter

public void finishFilter(java.io.OutputStream output)
                  throws java.io.IOException
Finishes the archive output filtering.

Parameters:
output - the filtered output.

Typically a statement like ((GZipOutputStream) output).finish().

java.io.IOException