public static void encrypt(OutputStream out, InputStream in, Encryptor e) throws IOException {
    OutputStream cout = e.createEncryptionStream(out);
    try {
      IOUtils.copy(in, cout);
    } finally {
      cout.close();
    }
  }
Encrypt a stream of plaintext given an encryptor
<p>
The encryptor's state will be finalized. It should be reinitialized or returned to the pool.
@param out ciphertext
@param in  plaintext
hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/Encryption.java