private static InputStream maybeWrapDecompress(InputStream in, boolean decompressZstd) throws IOException {
        return decompressZstd ? new ZstdInputStream(in) : in;
    }
Streams the contents of an input stream into an output stream after being wrapped by the input cipher.
Depending on the Cipher mode, this either encrypts a plaintext stream into ciphertext,
or decrypts a ciphertext stream into plaintext.

@param input source stream to read from
@param output destination stream to write to
@param cipher an {@link AeadCipher} created for either encryption or decryption
@throws IOException if any file operation fails
vespaclient-java/src/main/java/com/yahoo/vespa/security/tool/crypto/CipherUtils.java