code: public InputStream decrypt(InputStream source, SecretKey key) throws IOException {
  
          Cipher cipher = getCipher();
  
          // Remove the initialisation vector from the start of the stream.
          // NB if the stream is empty, the read will return -1 and no harm will
          // be done.
          byte[] iv = new byte[getIvSize(cipher)];
  
          // The IV can be stored unencrypted at the start of the stream:
          source.read(iv);
  
          // Get a cipher instance and create the cipherInputStream:
          initCipher(cipher, Cipher.DECRYPT_MODE, key, iv);
          CipherInputStream cipherInputStream = new CipherInputStream(source, cipher);
  
          // Return the initialised stream:
          return cipherInputStream;
      }
docs: This method wraps the source {@link InputStream} with a
  {@link CipherInputStream}.
  <p>
  Typical usage is when you have an InputStream for a source of encrypted
  data on disk, and an OutputStream to send the file to an HTTP response.
  You would call this method to wrap the InputStream and use the returned
  {@link CipherInputStream} to read the data from instead so that it is
  decrypted as it is read and can be written to the response unencrypted.
  <p>
  Note that this method reads and discards the random initialisation vector
  from the source InputStream, so the source parameter will have some bytes
  read from it before this method returns. These bytes are necessary for initialising
  decryption and the call to {@link #encrypt(OutputStream, SecretKey)} will
  have added these to the start of the underlying data automatically.
  
  @param source The source {@link InputStream}, containing encrypted data.
  @param key    The key to be used for decryption.
  @return A {@link CipherInputStream}, which wraps the given source stream
  and will decrypt the data as they are read.
  @throws IOException              If an error occurs in reading the initialisation vector from
  the source stream.
  @throws IllegalArgumentException If the given key is not a valid {@value #CIPHER_ALGORITHM}
  key.
  @see #encrypt(OutputStream, SecretKey)