Set DeterministicJarOutputStream's default compression level to 9

Signed-off-by: Graham <gpe@openrs2.dev>
bzip2
Graham 5 years ago
parent 451a1d9c5e
commit 0206bbd4b2
  1. 5
      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.nio.file.attribute.FileTime
import java.util.jar.JarOutputStream import java.util.jar.JarOutputStream
import java.util.jar.Manifest import java.util.jar.Manifest
import java.util.zip.Deflater
import java.util.zip.ZipEntry import java.util.zip.ZipEntry
class DeterministicJarOutputStream : JarOutputStream { class DeterministicJarOutputStream : JarOutputStream {
constructor(out: OutputStream) : super(out) constructor(out: OutputStream) : super(out)
constructor(out: OutputStream, man: Manifest) : super(out, man) constructor(out: OutputStream, man: Manifest) : super(out, man)
init {
setLevel(Deflater.BEST_COMPRESSION)
}
override fun putNextEntry(ze: ZipEntry) { override fun putNextEntry(ze: ZipEntry) {
ze.creationTime = UNIX_EPOCH ze.creationTime = UNIX_EPOCH
ze.lastAccessTime = UNIX_EPOCH ze.lastAccessTime = UNIX_EPOCH

Loading…
Cancel
Save