forked from openrs2/openrs2
This will provide a few benefits: - Some of the implementations can now be turned into objects, reducing memory allocation. - A single Resource.compressLibrary() method will be able to take a LibraryWriter, reducing duplication. Signed-off-by: Graham <gpe@openrs2.dev>bzip2
parent
46d8af509c
commit
daefa7f4ea
@ -1,7 +1,8 @@ |
||||
package dev.openrs2.asm.io |
||||
|
||||
import dev.openrs2.asm.classpath.Library |
||||
import java.io.InputStream |
||||
|
||||
interface LibraryReader { |
||||
fun read(): Library |
||||
fun read(input: InputStream): Library |
||||
} |
||||
|
@ -0,0 +1,12 @@ |
||||
package dev.openrs2.asm.io |
||||
|
||||
import dev.openrs2.util.io.DeterministicJarOutputStream |
||||
import java.io.OutputStream |
||||
import java.util.jar.JarOutputStream |
||||
import java.util.jar.Manifest |
||||
|
||||
class ManifestJarLibraryWriter(private val manifest: Manifest) : JarLibraryWriter() { |
||||
override fun createJarOutputStream(output: OutputStream): JarOutputStream { |
||||
return DeterministicJarOutputStream(output, manifest) |
||||
} |
||||
} |
Loading…
Reference in new issue