Skip to content

Commit

Permalink
Nicer code
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Jul 15, 2024
1 parent 41ba4db commit 7f9e183
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@


import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
Expand All @@ -26,13 +26,14 @@ public static void main(String... args) throws IOException {
}
int version = Integer.parseInt(args[0]);
if (version < 1 || version >= Constants.JAVA_VERSIONS.length) {
throw new RuntimeException("version not support yet!");
throw new RuntimeException("version not supported yet!");
}
File old = new File(args[1]);
File n = new File(args[2]);
byte[] buff = new byte[1024 * 50];
final int jVersion = Constants.JAVA_VERSIONS[version];
try (ZipFile zip = new ZipFile(old); ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(n))) {
try (ZipFile zip = new ZipFile(old); ZipOutputStream zos =
new ZipOutputStream(Files.newOutputStream(n.toPath()))) {

Enumeration<? extends ZipEntry> e = zip.entries();
while (e.hasMoreElements()) {
Expand Down

0 comments on commit 7f9e183

Please sign in to comment.