Code example for ZipOutputStream

Methods: closeEntry, putNextEntry, setMethod, write

0
            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) 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "setComment", 
        args = {java.lang.String.class}
    ) 
    public void test_setCommentLjava_lang_String() { 
        // There is no way to get the comment back, so no way to determine if 
        // the comment is set correct 
        zos.setComment("test setComment");
 
        try { 
            zos.setComment(new String(new byte[0xFFFF + 1]));