Code example for ZipFile

Methods: close, getEntry

0
        r = in.read();
        in.close();
        assertEquals("testdir1/ should not contain data", -1, r);
 
        zentry = zfile.getEntry("testdir1/testdir1");
        assertNotNull("Could not obtain ZipEntry: testdir1/testdir1", zentry);
        in = zfile.getInputStream(zentry);
        byte[] buf = new byte[256];
        r = in.read(buf);
        in.close();
        assertEquals("incorrect contents", "This is also text", new String(buf,
                0, r));
    } 
 
    @TestTargetNew( 
        level = TestLevel.PARTIAL_COMPLETE, 
        method = "getEntry", 
        args = {java.lang.String.class}
    ) 
    public void test_getEntryLjava_lang_String_AndroidOnly() throws IOException { 
        java.util.zip.ZipEntry zentry = zfile.getEntry("File1.txt");