Skip to content

Most visited

Recently visited

navigation
Added in API level 1

JarInputStream

public class JarInputStream
extends ZipInputStream

java.lang.Object
   ↳ java.io.InputStream
     ↳ java.io.FilterInputStream
       ↳ java.util.zip.InflaterInputStream
         ↳ java.util.zip.ZipInputStream
           ↳ java.util.jar.JarInputStream


The input stream from which the JAR file to be read may be fetched. It is used like the ZipInputStream.

See also:

Summary

Inherited constants

From class java.util.zip.ZipInputStream

Inherited fields

From class java.util.zip.InflaterInputStream
From class java.io.FilterInputStream

Public constructors

JarInputStream(InputStream stream, boolean verify)

Constructs a new JarInputStream from an input stream.

JarInputStream(InputStream stream)

Constructs a new JarInputStream from an input stream.

Public methods

void closeEntry()

Closes the current zip entry and prepares to read the next entry.

Manifest getManifest()

Returns the Manifest object associated with this JarInputStream or null if no manifest entry exists.

ZipEntry getNextEntry()

Returns the next ZipEntry contained in this stream or null if no more entries are present.

JarEntry getNextJarEntry()

Returns the next JarEntry contained in this stream or null if no more entries are present.

int read(byte[] buffer, int byteOffset, int byteCount)

Reads up to byteCount bytes of decompressed data and stores it in buffer starting at byteOffset.

Protected methods

ZipEntry createZipEntry(String name)

creates a ZipEntry with the given name.

Inherited methods

From class java.util.zip.ZipInputStream
From class java.util.zip.InflaterInputStream
From class java.io.FilterInputStream
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable
From interface java.lang.AutoCloseable

Public constructors

JarInputStream

Added in API level 1
JarInputStream (InputStream stream, 
                boolean verify)

Constructs a new JarInputStream from an input stream.

Parameters
stream InputStream: the input stream containing the JAR file.
verify boolean: if the file should be verified with a JarVerifier.
Throws
IOException If an error occurs reading entries from the input stream.

See also:

JarInputStream

Added in API level 1
JarInputStream (InputStream stream)

Constructs a new JarInputStream from an input stream.

Parameters
stream InputStream: the input stream containing the JAR file.
Throws
IOException If an error occurs reading entries from the input stream.

See also:

Public methods

closeEntry

Added in API level 1
void closeEntry ()

Closes the current zip entry and prepares to read the next entry.

Throws
IOException

getManifest

Added in API level 1
Manifest getManifest ()

Returns the Manifest object associated with this JarInputStream or null if no manifest entry exists.

Returns
Manifest the MANIFEST specifying the contents of the JAR file.

getNextEntry

Added in API level 1
ZipEntry getNextEntry ()

Returns the next ZipEntry contained in this stream or null if no more entries are present.

Returns
ZipEntry the next extracted ZIP entry.
Throws
IOException if an error occurs while reading the entry.

getNextJarEntry

Added in API level 1
JarEntry getNextJarEntry ()

Returns the next JarEntry contained in this stream or null if no more entries are present.

Returns
JarEntry the next JAR entry.
Throws
IOException if an error occurs while reading the entry.

read

Added in API level 1
int read (byte[] buffer, 
                int byteOffset, 
                int byteCount)

Reads up to byteCount bytes of decompressed data and stores it in buffer starting at byteOffset. Returns the number of uncompressed bytes read.

Parameters
buffer byte
byteOffset int
byteCount int
Returns
int
Throws
IOException if an IOException occurs.

Protected methods

createZipEntry

Added in API level 1
ZipEntry createZipEntry (String name)

creates a ZipEntry with the given name.

Parameters
name String: the name of the entry.
Returns
ZipEntry the created ZipEntry.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.