public void encrypt()

in encryption/src/main/java/org/apache/solr/encryption/crypto/CharStreamEncrypter.java [94:119]


  public void encrypt(Reader inputReader, int inputSizeHint, byte[] key, Appendable output)
    throws IOException {
    // Don't use jdk Base64.getEncoder().wrap() because it's buggy.
    int bufferSize = getBufferSize(inputSizeHint);
    try (OutputStreamWriter encryptedOutputWriter =
           new OutputStreamWriter(
             new EncryptingOutputStream(
               new Base64OutputStream(
                 new LightWriterOutputStream(
                   toWriter(output),
                   StandardCharsets.ISO_8859_1,
                   bufferSize
                 )
               ),
               key,
               factory
             ),
             StandardCharsets.UTF_8
           )
    ) {
      transfer(inputReader,
               encryptedOutputWriter,
               bufferSize
      );
    }
  }