|
|
@ -63,10 +63,12 @@ public final class Library implements Iterable<ClassNode> { |
|
|
|
|
|
|
|
|
|
|
|
var temp = Files.createTempFile(TEMP_PREFIX, JAR_SUFFIX); |
|
|
|
var temp = Files.createTempFile(TEMP_PREFIX, JAR_SUFFIX); |
|
|
|
try { |
|
|
|
try { |
|
|
|
try (var header = new ByteArrayInputStream(GZIP_HEADER); |
|
|
|
try ( |
|
|
|
|
|
|
|
var header = new ByteArrayInputStream(GZIP_HEADER); |
|
|
|
var data = Files.newInputStream(path); |
|
|
|
var data = Files.newInputStream(path); |
|
|
|
var in = new GZIPInputStream(new SequenceInputStream(header, data)); |
|
|
|
var in = new GZIPInputStream(new SequenceInputStream(header, data)); |
|
|
|
var out = new JarOutputStream(Files.newOutputStream(temp))) { |
|
|
|
var out = new JarOutputStream(Files.newOutputStream(temp)) |
|
|
|
|
|
|
|
) { |
|
|
|
Pack200.newUnpacker().unpack(in, out); |
|
|
|
Pack200.newUnpacker().unpack(in, out); |
|
|
|
return readJar(temp); |
|
|
|
return readJar(temp); |
|
|
|
} |
|
|
|
} |
|
|
@ -138,8 +140,10 @@ public final class Library implements Iterable<ClassNode> { |
|
|
|
try { |
|
|
|
try { |
|
|
|
writeJar(temp, remapper); |
|
|
|
writeJar(temp, remapper); |
|
|
|
|
|
|
|
|
|
|
|
try (var in = new JarInputStream(Files.newInputStream(temp)); |
|
|
|
try ( |
|
|
|
var out = new GZIPOutputStream(new SkipOutputStream(Files.newOutputStream(path), 2))) { |
|
|
|
var in = new JarInputStream(Files.newInputStream(temp)); |
|
|
|
|
|
|
|
var out = new GZIPOutputStream(new SkipOutputStream(Files.newOutputStream(path), 2)) |
|
|
|
|
|
|
|
) { |
|
|
|
Pack200.newPacker().pack(in, out); |
|
|
|
Pack200.newPacker().pack(in, out); |
|
|
|
} |
|
|
|
} |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|