From e5ba4f99334be1abc59ff655903a381ab2c596cc Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 21 Jun 2022 19:48:49 +0200 Subject: [PATCH] Add buffer to improve encryption performance --- .../org/pgpainless/encryption_signing/EncryptionStream.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionStream.java b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionStream.java index dbfc737e..50f5cb5f 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionStream.java +++ b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionStream.java @@ -82,6 +82,9 @@ public final class EncryptionStream extends OutputStream { return; } + // ArmoredOutputStream better be buffered + outermostStream = new BufferedOutputStream(outermostStream); + LOGGER.debug("Wrap encryption output in ASCII armor"); armorOutputStream = ArmoredOutputStreamFactory.get(outermostStream); if (options.hasComment()) {