Remove createLaxInputStream() method

It's rather pointless - the constructor can be called directly.

Signed-off-by: Graham <gpe@openrs2.org>
Graham 3 years ago
parent 6c508922fc
commit 71e7c6f8ea
  1. 4
      compress-cli/src/main/kotlin/org/openrs2/compress/cli/gzip/GunzipLaxCommand.kt
  2. 4
      compress/src/main/kotlin/org/openrs2/compress/gzip/Gzip.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.defaultStdout
import com.github.ajalt.clikt.parameters.types.inputStream import com.github.ajalt.clikt.parameters.types.inputStream
import com.github.ajalt.clikt.parameters.types.outputStream 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") { public class GunzipLaxCommand : CliktCommand(name = "gunzip-lax") {
private val input by option().inputStream().defaultStdin() private val input by option().inputStream().defaultStdin()
private val output by option().outputStream(truncateExisting = true).defaultStdout() private val output by option().outputStream(truncateExisting = true).defaultStdout()
override fun run() { override fun run() {
Gzip.createLaxInputStream(input).use { input -> GzipLaxInputStream(input).use { input ->
output.use { output -> output.use { output ->
input.copyTo(output) input.copyTo(output)
} }

@ -21,8 +21,4 @@ public object Gzip {
): OutputStream { ): OutputStream {
return GzipLevelOutputStream(SkipOutputStream(output, HEADER.size.toLong()), level) return GzipLevelOutputStream(SkipOutputStream(output, HEADER.size.toLong()), level)
} }
public fun createLaxInputStream(input: InputStream): InputStream {
return GzipLaxInputStream(input)
}
} }

Loading…
Cancel
Save