code: private void createStreams(SecretKey encryptionKey, SecretKey hmacKey,
        byte[] iv, OutputStream out) throws CryptorException {
  
      this.iv = iv;
  
      try {
        Cipher cipher = Cipher.getInstance(AES256JNCryptor.AES_CIPHER_ALGORITHM);
        cipher.init(Cipher.ENCRYPT_MODE, encryptionKey, new IvParameterSpec(iv));
  
        try {
          Mac mac = Mac.getInstance(AES256JNCryptor.HMAC_ALGORITHM);
          mac.init(hmacKey);
  
          macOutputStream = new MacOutputStream(out, mac);
          cipherStream = new CipherOutputStream(macOutputStream, cipher);
  
        } catch (GeneralSecurityException e) {
          throw new CryptorException("Failed to initialize HMac", e);
        }
  
      } catch (GeneralSecurityException e) {
        throw new CryptorException("Failed to initialize AES cipher", e);
      }
    }
docs: Creates the cipher and MAC streams required,
  
  @param encryptionKey
  the encryption key
  @param hmacKey
  the HMAC key
  @param iv
  the IV
  @param out
  the output stream we are wrapping
  @throws CryptorException