From f82385e58741aa83dccc4876ae69a6033217d9ed Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Sat, 18 Feb 2023 11:58:05 +0000 Subject: [PATCH] 8302623: jarsigner - use BufferedOutputStream to improve performance while creating the signed jar Reviewed-by: weijun --- .../share/classes/jdk/security/jarsigner/JarSigner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java b/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java index e279c5a084b..97d3d2ba877 100644 --- a/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java +++ b/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java @@ -688,7 +688,8 @@ public final class JarSigner { throw new AssertionError(asae); } - ZipOutputStream zos = new ZipOutputStream(os); + ZipOutputStream zos = new ZipOutputStream( + (os instanceof BufferedOutputStream) ? os : new BufferedOutputStream(os)); Manifest manifest = new Manifest(); byte[] mfRawBytes = null;