Code example for JarInputStream

0
    public void test_ConstructorLjava_io_InputStreamZ() { 
        try { 
            // we need a buffered stream because ByteArrayInputStream.close() is a no-op 
            InputStream is = new BufferedInputStream(new ByteArrayInputStream(new byte[0]));
            is.close();
            new JarInputStream(is, false);
            fail("IOException expected");
        } catch (IOException ee) {
            // expected 
        } 
    } 
 
 
    class Mock_JarInputStream extends JarInputStream {
 
        public Mock_JarInputStream(InputStream in) throws IOException {
            super(in);
        } 
 
        public ZipEntry createZipEntry(String str) {
            return super.createZipEntry(str);