Pipeline Items

A pipeline item is at the same time a faucet and a sink. A pure pipeline item simply transforms its input to its output. For example, a byte transforming pipeline item takes a byte stream and transforms it to another byte stream. In order to do this, the user has to write a script (in a JSR-233 compliant scripting language that their system supports) that implements this function:

public abstract byte[] transformBuffer(byte[] buffer, int off, int len);

This, as you probably guessed, is the definition of the function in Java. The idea is that this function will be called each time a buffer is read from the source stream, plus one final time when the input stream is finished, at which time the len parameter will be -1 to signify that fact.