From 26d5d5fd6e1676a3aa2a1fcf22abed8620bfc1d1 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 29 Jan 2022 21:45:25 +0000 Subject: [PATCH] Use JagexGzipOutputStream to compress gzipped JS5 containers The output is bit-for-bit identical to Jagex's implementation. Signed-off-by: Graham --- .../src/main/kotlin/org/openrs2/cache/Js5CompressionType.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cache/src/main/kotlin/org/openrs2/cache/Js5CompressionType.kt b/cache/src/main/kotlin/org/openrs2/cache/Js5CompressionType.kt index 3f9be3469b..e3e7844722 100644 --- a/cache/src/main/kotlin/org/openrs2/cache/Js5CompressionType.kt +++ b/cache/src/main/kotlin/org/openrs2/cache/Js5CompressionType.kt @@ -1,11 +1,10 @@ package org.openrs2.cache import org.openrs2.compress.bzip2.Bzip2 -import org.openrs2.compress.gzip.GzipLevelOutputStream +import org.openrs2.compress.gzip.JagexGzipOutputStream import org.openrs2.compress.lzma.Lzma import java.io.InputStream import java.io.OutputStream -import java.util.zip.Deflater import java.util.zip.GZIPInputStream public enum class Js5CompressionType { @@ -27,7 +26,7 @@ public enum class Js5CompressionType { return when (this) { UNCOMPRESSED -> output BZIP2 -> Bzip2.createHeaderlessOutputStream(output) - GZIP -> GzipLevelOutputStream(output, Deflater.BEST_COMPRESSION) + GZIP -> JagexGzipOutputStream(output) /* * LZMA at -9 has significantly higher CPU/memory requirements for * both compression _and_ decompression, so we use the default of