Code example for ZipEntry

Methods: getSize

0
    /** 
     * @tests java.util.zip.ZipOutputStream#closeEntry() 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "ZipException can not be checked.", 
        method = "closeEntry", 
        args = {} 
    ) 
    public void test_closeEntry() throws IOException { 
        ZipEntry ze = new ZipEntry("testEntry");
        ze.setTime(System.currentTimeMillis());
        zos.putNextEntry(ze);
        zos.write("Hello World".getBytes("UTF-8"));
        zos.closeEntry();
        assertTrue("closeEntry failed to update required fields",
                ze.getSize() == 11 && ze.getCompressedSize() == 13);
        ze = new ZipEntry("testEntry1");
        zos.close();
        try { 
Stop searching for code, let great code find you!  Add Codota to your java IDE