code: public final void decryptStream(SecretKey sharedKey, InputStream input, OutputStream output) throws IOException {
          logger.entry();
          CipherInputStream cipherInput = null;
          try {
              logger.debug("Creating a special input stream to do the work...");
              cipherInput = decryptionInputStream(sharedKey, input);
  
              logger.debug("Reading bytes, decrypting them, and writing them out...");
              IOUtils.copy(cipherInput, output);
              output.flush();
          } finally {
              if (cipherInput != null) cipherInput.close();
          }
          logger.exit();
      }
docs: This method decrypts a byte stream from an encrypted byte stream.
  
  @param sharedKey The shared key used for the encryption.
  @param input The encrypted byte stream.
  @param output The decrypted byte stream.
  @throws java.io.IOException Unable to decrypt the stream.