Code example for JarOutputStream

0
        String name = outFile.getName();
        String tzname = name.substring(name.lastIndexOf(".") + 1);
        JarOutputStream jos = null;
        try { 
            TimeZone.setDefault(TimeZone.getTimeZone(tzname));
            jos = new JarOutputStream(new FileOutputStream(outFile));
            System.out.println("Using timezone: " + TimeZone.getDefault());
            Utils.unpackj(packFile, jos);
        } finally { 
            Utils.close(jos);
            TimeZone.setDefault(tz); // always reset
        } 
    } 
 
    static void verifyJar(File f1, File f2) throws IOException {
        int errors = 0;
        JarFile jf1 = null;
        JarFile jf2 = null;
        try { 
            jf1 = new JarFile(f1);
Experience pair programming with AI  Get Codota for Java