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.
24 lines
883 B
24 lines
883 B
package org.openrs2.asm.io
|
|
|
|
import org.objectweb.asm.tree.ClassNode
|
|
import org.openrs2.asm.classpath.ClassPath
|
|
import org.openrs2.compress.gzip.Gzip
|
|
import java.io.ByteArrayInputStream
|
|
import java.io.ByteArrayOutputStream
|
|
import java.io.OutputStream
|
|
import java.util.jar.JarInputStream
|
|
import java.util.jar.Pack200
|
|
|
|
public object Pack200LibraryWriter : LibraryWriter {
|
|
override fun write(output: OutputStream, classPath: ClassPath, classes: Iterable<ClassNode>) {
|
|
ByteArrayOutputStream().use { tempOutput ->
|
|
JarLibraryWriter.write(tempOutput, classPath, classes)
|
|
|
|
return JarInputStream(ByteArrayInputStream(tempOutput.toByteArray())).use { jarInput ->
|
|
Gzip.createHeaderlessOutputStream(output).use { gzipOutput ->
|
|
Pack200.newPacker().pack(jarInput, gzipOutput)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|