diff --git a/compress-cli/src/main/kotlin/org/openrs2/compress/cli/CompressCommand.kt b/compress-cli/src/main/kotlin/org/openrs2/compress/cli/CompressCommand.kt index eaf4a2da..0a401022 100644 --- a/compress-cli/src/main/kotlin/org/openrs2/compress/cli/CompressCommand.kt +++ b/compress-cli/src/main/kotlin/org/openrs2/compress/cli/CompressCommand.kt @@ -9,6 +9,7 @@ import org.openrs2.compress.cli.deflate.InflateCommand import org.openrs2.compress.cli.gzip.GunzipCommand import org.openrs2.compress.cli.gzip.GunzipLaxCommand import org.openrs2.compress.cli.gzip.GzipCommand +import org.openrs2.compress.cli.gzip.GzipJagexCommand import org.openrs2.compress.cli.lzma.LzmaCommand import org.openrs2.compress.cli.lzma.UnlzmaCommand import org.openrs2.compress.cli.pack200.Pack200Command @@ -26,6 +27,7 @@ public class CompressCommand : NoOpCliktCommand(name = "compress") { DeflateCommand(), InflateCommand(), GzipCommand(), + GzipJagexCommand(), GunzipCommand(), GunzipLaxCommand(), LzmaCommand(), diff --git a/compress-cli/src/main/kotlin/org/openrs2/compress/cli/gzip/GzipJagexCommand.kt b/compress-cli/src/main/kotlin/org/openrs2/compress/cli/gzip/GzipJagexCommand.kt new file mode 100644 index 00000000..dcbc5318 --- /dev/null +++ b/compress-cli/src/main/kotlin/org/openrs2/compress/cli/gzip/GzipJagexCommand.kt @@ -0,0 +1,22 @@ +package org.openrs2.compress.cli.gzip + +import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.parameters.options.option +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.JagexGzipOutputStream + +public class GzipJagexCommand : CliktCommand(name = "gzip-jagex") { + private val input by option().inputStream().defaultStdin() + private val output by option().outputStream(truncateExisting = true).defaultStdout() + + override fun run() { + input.use { input -> + JagexGzipOutputStream(output).use { output -> + input.copyTo(output) + } + } + } +}