Code example for ZipInputStream

Methods: close

0
            fail("Writing data without an entry. Should have thrown IOException");
        } catch (IOException e) {
            // expected 
        } 
 
        try { 
            // Try to write without an entry and with nonsense offset and 
            // length 
            zip.write(new byte[2], 0, 12);
            fail("Writing data without an entry. Should have thrown IndexOutOfBoundsException");
        } catch (IndexOutOfBoundsException e) {
            // expected 
        } 
         
        // Regression for HARMONY-4405 
        try { 
            zip.write(null, 0, -2);
            fail("Should throw IndexOutOfBoundsException");
        } catch (IndexOutOfBoundsException e) {
            // expected 
        }