import
java.io.FileInputStream;
import
java.io.IOException;
import
java.io.InputStream;
import
java.util.Arrays;
import
java.util.jar.JarInputStream;
import
java.util.zip.ZipEntry;
class
JarInputStreamDemo
extends
JarInputStream
{
public
JarInputStreamDemo(InputStream in)
throws
IOException
{
super
(in);
}
public
static
void
main(String[] args)
throws
IOException
{
FileInputStream is =
new
FileInputStream(
"codechecker.jar"
);
JarInputStream jis =
new
JarInputStream(is);
JarInputStreamDemo obj=
new
JarInputStreamDemo(jis);
ZipEntry ze1=obj.createZipEntry(
"ZipEntry"
);
System.out.println(ze1.getName());
ZipEntry ze=jis.getNextEntry();
System.out.println(ze.getName());
System.out.println(jis.getManifest());
byte
b[] =
new
byte
[
10
];
while
(jis.getNextJarEntry()!=
null
)
jis.read(b);
System.out.print(Arrays.toString(b));
jis.close();
}
}