From 71e7c6f8ea7f391c130434b3b98304858cb1b644 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 29 Jan 2022 21:39:27 +0000 Subject: [PATCH] Remove createLaxInputStream() method It's rather pointless - the constructor can be called directly. Signed-off-by: Graham --- .../kotlin/org/openrs2/compress/cli/gzip/GunzipLaxCommand.kt | 4 ++-- compress/src/main/kotlin/org/openrs2/compress/gzip/Gzip.kt | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/compress-cli/src/main/kotlin/org/openrs2/compress/cli/gzip/GunzipLaxCommand.kt b/compress-cli/src/main/kotlin/org/openrs2/compress/cli/gzip/GunzipLaxCommand.kt index d26166284b..ae65184c34 100644 --- a/compress-cli/src/main/kotlin/org/openrs2/compress/cli/gzip/GunzipLaxCommand.kt +++ b/compress-cli/src/main/kotlin/org/openrs2/compress/cli/gzip/GunzipLaxCommand.kt @@ -6,14 +6,14 @@ import com.github.ajalt.clikt.parameters.types.defaultStdin import com.github.ajalt.clikt.parameters.types.defaultStdout import com.github.ajalt.clikt.parameters.types.inputStream import com.github.ajalt.clikt.parameters.types.outputStream -import org.openrs2.compress.gzip.Gzip +import org.openrs2.compress.gzip.GzipLaxInputStream public class GunzipLaxCommand : CliktCommand(name = "gunzip-lax") { private val input by option().inputStream().defaultStdin() private val output by option().outputStream(truncateExisting = true).defaultStdout() override fun run() { - Gzip.createLaxInputStream(input).use { input -> + GzipLaxInputStream(input).use { input -> output.use { output -> input.copyTo(output) } diff --git a/compress/src/main/kotlin/org/openrs2/compress/gzip/Gzip.kt b/compress/src/main/kotlin/org/openrs2/compress/gzip/Gzip.kt index 44073769eb..037ebf4000 100644 --- a/compress/src/main/kotlin/org/openrs2/compress/gzip/Gzip.kt +++ b/compress/src/main/kotlin/org/openrs2/compress/gzip/Gzip.kt @@ -21,8 +21,4 @@ public object Gzip { ): OutputStream { return GzipLevelOutputStream(SkipOutputStream(output, HEADER.size.toLong()), level) } - - public fun createLaxInputStream(input: InputStream): InputStream { - return GzipLaxInputStream(input) - } }