Modifier and Type | Method and Description |
---|---|
void |
closeProcess()
This aborts any on-going processing and frees resources associated with the processor.
|
int |
getBlockSize()
This returns the size of a block to be processed - any data blocks
presented for processing must be multiples of this size.
|
int |
getMaxBlockSize()
This returns the largest block that can be processed.
|
ByteArray |
processBlock(byte[] inputData,
int offset,
int length,
boolean isLastBlock,
ByteArray output)
This processes a block of data and places the output in the provided ByteArray.
|
int getBlockSize()
int getMaxBlockSize()
ByteArray processBlock(byte[] inputData, int offset, int length, boolean isLastBlock, ByteArray output) throws IOException
isLastBlock should be set true if this is the last set of data to be processed. If you want to end a processing run, but have no more data to provide - you can set length to be zero (you can then also set inputData to be null) and set isLastBlock true.
If isLastBlock is true the DataProcessor should accept any input data, complete processing and output ALL of any remaining processed data. It should then reset itself so that the next call of processBlock is considered to be the start of a new sequence of data.
If there is an error processing the data, an IOException should be thrown.
IOException
void closeProcess() throws IOException
IOException