Methods Summary |
---|
public boolean | consume(byte[] data)
boolean success;
success = preConsume(data);
if (success)
success = doConsume(data);
if (success)
success = postConsume(data);
return success;
|
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;
|
protected boolean | doConsume(byte[] data)
boolean success = false;
if (dest != null) {
success = dest.consume(data);
}
return true;
|
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 | setDest(dcj.util.Bandwidth.ContentConsumer c)
dest = c;
|
public void | setDest(java.io.OutputStream s)
dest = new ContentConsumer(s);
|
public void | setSource(ContentProducer p)
source = p;
|
public void | setSource(java.io.InputStream s)
source = new ContentProducer(s);
|