Code example for ZipEntry

Methods: getCompressedSize

0
        zos.putNextEntry(ze);
        zos.write("Hello World".getBytes());
        zos.closeEntry();
        zos.close();
        zis = new ZipInputStream(new ByteArrayInputStream(bos.toByteArray()));
        ZipEntry ze2 = zis.getNextEntry();
        zis.closeEntry();
        assertTrue("Failed to write correct entry", ze.getName().equals(
                ze2.getName())
                && ze.getCrc() == ze2.getCrc());
        try { 
            zos.putNextEntry(ze);
            fail("Entry with incorrect setting failed to throw exception");
        } catch (IOException e) {
            // expected 
        } 
    } 
 
    /** 
     * @tests java.util.zip.ZipOutputStream#setComment(java.lang.String) 
     */