public class Pipeline
- extends Object
Class that sends a byte stream through a sequence of filters.
Each filter receives as input the (potentially modified) output
of the previous filter in the chain.
The pipeline works in push
mode and is non blocking. This distinguishes it from a chain
of (Filter)InputStreams. Also, a filter is not required to process
all received data on each invocation (in which case it gets a chance to process
the unprocessed data during the next invocation). This is useful when
the filter requires more lookahead than is available. This
distinguishes a pipeline from a chain of (Filter)OutputStreams (where each
OutputStream is responsible itself for buffering unprocessed data).
Finally, the implementation optimizes buffer allocation and minimizes
array copy operations.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Pipeline(int bufferSize)
public void setErrorListener(ErrorListener errorListener)
public void addFilter(StreamFilter filter)
public int readFrom(InputStream in)
public void close()
public OutputStream getOutputStream()
Copyright © The Apache Software Foundation. All Rights Reserved.