Byte Stream Demux Transform Pipeline Item

A byte stream demux transform pipeline item is a demupltiplexer that takes a byte stream as input and generates a sequence of byte streams as output. In order to facilitate a custom transform of the byte stream, the user has to specify in a JSR-223 compliant script, the implementation of the following functions:

public abstract byte[] transformBuffer(byte[] buffer, int offset, int length);

public abstract boolean shouldChangePipeline();

The transformBuffer() method will be called each time a buffer is read in order for the script implementation to transform it as needed. The additional shouldChangePipeline method should return true, when the boundaries of one result stream has been reached and another should be started. The transformBuffer() method is going to be called with a length parameter of -1 when the end of the input stream is reached.