final ByteArrayInputStream inputStream =
new ByteArrayInputStream(encryptedData);
// Create the block decryptor passing in the unformatter engine and
// the encrypted data.
final BlockDecryptor decryptor =
new BlockDecryptor(unformatterEngine, inputStream);
// Now we want to read from the stream. We are going to read the
// data 10 bytes at a time and then add the new data to the
// decryptedData array. It is important to note that for
// efficiency one would most likely want to use a larger
// value than 10. We use a small value so that we can
// demonstrate several iterations through the loop.
final byte[] temp = new byte[10];
final DataBuffer db = new DataBuffer();
for (;;) {
final int bytesRead = decryptor.read(temp);
if (bytesRead <= 0) {
// We have run out of information to read, bail out of loop
break;
}