Methods Summary |
---|
protected void | buildFilter()
if (in != null && out != null) {
in.setSource(out);
out.setDest(in);
}
|
public boolean | consume()
boolean success = false;
if (source != null) {
byte[] data = source.produce();
// byte[] data = null;
while (data != null) {
success = consume(data);
data = source.produce();
}
}
return success;
|
public boolean | consume(byte[] data)
boolean success;
success = preConsume(data);
if (success)
success = doConsume(data);
if (success)
success = postConsume(data);
return success;
|
protected boolean | doConsume(byte[] data)
boolean success = false;
if (dest != null) {
success = dest.consume(data);
}
return true;
|
public ContentConsumer | getInput() return in;
|
public ContentProducer | getOutput() return out;
|
protected boolean | postConsume(byte[] data)
monitor.addSample(data.length);
return true;
|
protected boolean | preConsume(byte[] data)
if (monitor.getStart() == null)
monitor.start();
return true;
|
public void | setInput(ContentConsumer c)
in = c;
buildFilter();
|
public void | setOutput(ContentProducer p)
out = p;
buildFilter();
|