Home » openjdk-7 » java » util » jar » [javadoc | source]
java.util.jar
public class: JarInputStream [javadoc | source]
java.lang.Object
   java.io.InputStream
      java.io.FilterInputStream
         java.util.zip.InflaterInputStream
            java.util.zip.ZipInputStream
               java.util.jar.JarInputStream

All Implemented Interfaces:
    ZipConstants, Closeable

The JarInputStream class is used to read the contents of a JAR file from any input stream. It extends the class java.util.zip.ZipInputStream with support for reading an optional Manifest entry. The Manifest can be used to store meta-information about the JAR file and its entries.
Fields inherited from java.util.zip.InflaterInputStream:
inf,  buf,  len,  usesDefaultInflater
Fields inherited from java.io.FilterInputStream:
in
Constructor:
 public JarInputStream(InputStream in) throws IOException 
    Creates a new JarInputStream and reads the optional manifest. If a manifest is present, also attempts to verify the signatures if the JarInputStream is signed.
    Parameters:
    in - the actual input stream
    Throws:
    IOException - if an I/O error has occurred
    exception: IOException - if an I/O error has occurred
 public JarInputStream(InputStream in,
    boolean verify) throws IOException 
    Creates a new JarInputStream and reads the optional manifest. If a manifest is present and verify is true, also attempts to verify the signatures if the JarInputStream is signed.
    Parameters:
    in - the actual input stream
    verify - whether or not to verify the JarInputStream if it is signed.
    Throws:
    IOException - if an I/O error has occurred
    exception: IOException - if an I/O error has occurred
Method from java.util.jar.JarInputStream Summary:
createZipEntry,   getManifest,   getNextEntry,   getNextJarEntry,   read
Methods from java.util.zip.ZipInputStream:
available,   close,   closeEntry,   createZipEntry,   getNextEntry,   read,   skip
Methods from java.util.zip.InflaterInputStream:
available,   close,   fill,   mark,   markSupported,   read,   read,   reset,   skip
Methods from java.io.FilterInputStream:
available,   close,   mark,   markSupported,   read,   read,   read,   reset,   skip
Methods from java.io.InputStream:
available,   close,   mark,   markSupported,   read,   read,   read,   reset,   skip
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.util.jar.JarInputStream Detail:
 protected ZipEntry createZipEntry(String name) 
    Creates a new JarEntry (ZipEntry) for the specified JAR file entry name. The manifest attributes of the specified JAR file entry name will be copied to the new JarEntry.
 public Manifest getManifest() 
    Returns the Manifest for this JAR file, or null if none.
 public ZipEntry getNextEntry() throws IOException 
    Reads the next ZIP file entry and positions the stream at the beginning of the entry data. If verification has been enabled, any invalid signature detected while positioning the stream for the next entry will result in an exception.
 public JarEntry getNextJarEntry() throws IOException 
    Reads the next JAR file entry and positions the stream at the beginning of the entry data. If verification has been enabled, any invalid signature detected while positioning the stream for the next entry will result in an exception.
 public int read(byte[] b,
    int off,
    int len) throws IOException 
    Reads from the current JAR file entry into an array of bytes. If len is not zero, the method blocks until some input is available; otherwise, no bytes are read and 0 is returned. If verification has been enabled, any invalid signature on the current entry will be reported at some point before the end of the entry is reached.