From 0206bbd4b2eca160079c4fab85fe3df8d16de05c Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 2 May 2020 22:19:48 +0100 Subject: [PATCH] Set DeterministicJarOutputStream's default compression level to 9 Signed-off-by: Graham --- .../java/dev/openrs2/util/io/DeterministicJarOutputStream.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/src/main/java/dev/openrs2/util/io/DeterministicJarOutputStream.kt b/util/src/main/java/dev/openrs2/util/io/DeterministicJarOutputStream.kt index ce2e0bc7ab..71d2a4791b 100644 --- a/util/src/main/java/dev/openrs2/util/io/DeterministicJarOutputStream.kt +++ b/util/src/main/java/dev/openrs2/util/io/DeterministicJarOutputStream.kt @@ -4,12 +4,17 @@ import java.io.OutputStream import java.nio.file.attribute.FileTime import java.util.jar.JarOutputStream import java.util.jar.Manifest +import java.util.zip.Deflater import java.util.zip.ZipEntry class DeterministicJarOutputStream : JarOutputStream { constructor(out: OutputStream) : super(out) constructor(out: OutputStream, man: Manifest) : super(out, man) + init { + setLevel(Deflater.BEST_COMPRESSION) + } + override fun putNextEntry(ze: ZipEntry) { ze.creationTime = UNIX_EPOCH ze.lastAccessTime = UNIX_EPOCH