Code example for ZipFile

Methods: close, getEntry, getInputStream

0
        int result;
        byte[] buf = new byte[4096];
        while ((result = in.read(buf)) != -1) {
            out.write(buf, 0, result);
        } 
        in.close();
        out.close();
        /* 
         * ZipFile zip = new ZipFile(file); ZipEntry entry1 = 
         * zip.getEntry("File1.txt"); assertNotNull("Did not find entry", 
         * entry1); entry1 = null; zip = null; 
         */ 
 
        assertNotNull("Did not find entry",
                test_finalize1(test_finalize2(file)));
        System.gc();
        System.gc();
        System.runFinalization();
        file.delete();
        assertTrue("Zip should not exist", !file.exists());
    }