Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
1.0 KiB
23 lines
1.0 KiB
package org.openrs2.compress.cli.packclass
|
|
|
|
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 io.netty.buffer.ByteBufAllocator
|
|
import org.openrs2.asm.classpath.ClassPath
|
|
import org.openrs2.asm.io.JarLibraryWriter
|
|
import org.openrs2.asm.io.PackClassLibraryReader
|
|
|
|
public class UnpackClassCommand : CliktCommand(name = "unpackclass") {
|
|
private val input by option().inputStream().defaultStdin()
|
|
private val output by option().outputStream().defaultStdout()
|
|
|
|
override fun run() {
|
|
val classes = PackClassLibraryReader(ByteBufAllocator.DEFAULT).read(input)
|
|
val classPath = ClassPath(ClassLoader.getPlatformClassLoader(), emptyList(), emptyList())
|
|
JarLibraryWriter.write(output, classPath, classes)
|
|
}
|
|
}
|
|
|