# JarInputStream

public class **JarInputStream** extends [ZipInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html)  
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.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/Manifest.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html`

### Inherited Constant Summary

From class [java.util.zip.ZipInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html)

|---|---|---|
| int | [CENATT](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENATT) |   |
| int | [CENATX](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENATX) |   |
| int | [CENCOM](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENCOM) |   |
| int | [CENCRC](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENCRC) |   |
| int | [CENDSK](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENDSK) |   |
| int | [CENEXT](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENEXT) |   |
| int | [CENFLG](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENFLG) |   |
| int | [CENHDR](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENHDR) |   |
| int | [CENHOW](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENHOW) |   |
| int | [CENLEN](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENLEN) |   |
| int | [CENNAM](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENNAM) |   |
| int | [CENOFF](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENOFF) |   |
| long | [CENSIG](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENSIG) |   |
| int | [CENSIZ](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENSIZ) |   |
| int | [CENTIM](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENTIM) |   |
| int | [CENVEM](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENVEM) |   |
| int | [CENVER](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#CENVER) |   |
| int | [ENDCOM](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#ENDCOM) |   |
| int | [ENDHDR](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#ENDHDR) |   |
| int | [ENDOFF](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#ENDOFF) |   |
| long | [ENDSIG](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#ENDSIG) |   |
| int | [ENDSIZ](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#ENDSIZ) |   |
| int | [ENDSUB](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#ENDSUB) |   |
| int | [ENDTOT](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#ENDTOT) |   |
| int | [EXTCRC](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#EXTCRC) |   |
| int | [EXTHDR](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#EXTHDR) |   |
| int | [EXTLEN](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#EXTLEN) |   |
| long | [EXTSIG](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#EXTSIG) |   |
| int | [EXTSIZ](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#EXTSIZ) |   |
| int | [LOCCRC](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#LOCCRC) |   |
| int | [LOCEXT](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#LOCEXT) |   |
| int | [LOCFLG](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#LOCFLG) |   |
| int | [LOCHDR](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#LOCHDR) |   |
| int | [LOCHOW](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#LOCHOW) |   |
| int | [LOCLEN](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#LOCLEN) |   |
| int | [LOCNAM](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#LOCNAM) |   |
| long | [LOCSIG](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#LOCSIG) |   |
| int | [LOCSIZ](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#LOCSIZ) |   |
| int | [LOCTIM](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#LOCTIM) |   |
| int | [LOCVER](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#LOCVER) |   |

### Inherited Field Summary

From class [java.util.zip.InflaterInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html)

|---|---|---|
| protected byte\[\] | [buf](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#buf) | Input buffer for decompression. |
| protected boolean | [closed](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#closed) | *This field is deprecated. This field will be removed from a future version of Android and should not be used. Subclasses that access this field need to be modified to keep track of their own closed state by overriding close().* |
| protected [Inflater](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Inflater.html) | [inf](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#inf) | Decompressor for this stream. |
| protected int | [len](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#len) | Length of input buffer. |

From class [java.io.FilterInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html)

|---|---|---|
| protected [InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) | [in](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#in) | The input stream to be filtered. |

### Public Constructor Summary

|---|---|
|   | [JarInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarInputStream.html#JarInputStream(java.io.InputStream))([InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) in) Creates a new `JarInputStream` and reads the optional manifest. |
|   | [JarInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarInputStream.html#JarInputStream(java.io.InputStream,%20boolean))([InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) in, boolean verify) Creates a new `JarInputStream` and reads the optional manifest. |

### Public Method Summary

|---|---|
| [Manifest](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/Manifest.html) | [getManifest](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarInputStream.html#getManifest())() Returns the `Manifest` for this JAR file, or `null` if none. |
| [ZipEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipEntry.html) | [getNextEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarInputStream.html#getNextEntry())() Reads the next ZIP file entry and positions the stream at the beginning of the entry data. |
| [JarEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarEntry.html) | [getNextJarEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarInputStream.html#getNextJarEntry())() Reads the next JAR file entry and positions the stream at the beginning of the entry data. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarInputStream.html#read(byte[],%20int,%20int))(byte\[\] b, int off, int len) Reads from the current JAR file entry into an array of bytes. |

### Protected Method Summary

|---|---|
| [ZipEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipEntry.html) | [createZipEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarInputStream.html#createZipEntry(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Creates a new `JarEntry` (`ZipEntry`) for the specified JAR file entry name. |

### Inherited Method Summary

From class [java.util.zip.ZipInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html)

|---|---|
| int | [available](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#available())() Returns 0 after EOF has reached for the current entry data, otherwise always return 1. |
| void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#close())() Closes this input stream and releases any system resources associated with the stream. |
| void | [closeEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#closeEntry())() Closes the current ZIP entry and positions the stream for reading the next entry. |
| [ZipEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipEntry.html) | [createZipEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#createZipEntry(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Creates a new `ZipEntry` object for the specified entry name. |
| [ZipEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipEntry.html) | [getNextEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#getNextEntry())() Reads the next ZIP file entry and positions the stream at the beginning of the entry data. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#read(byte[],%20int,%20int))(byte\[\] b, int off, int len) Reads from the current ZIP entry into an array of bytes. |
| long | [skip](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html#skip(long))(long n) Skips specified number of bytes in the current ZIP entry. |

From class [java.util.zip.InflaterInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html)

|---|---|
| int | [available](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#available())() Returns 0 after EOF has been reached, otherwise always return 1. |
| void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#close())() Closes this input stream and releases any system resources associated with the stream. |
| void | [fill](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#fill())() Fills input buffer with more data to decompress. |
| synchronized void | [mark](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#mark(int))(int readlimit) Marks the current position in this input stream. |
| boolean | [markSupported](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#markSupported())() Tests if this input stream supports the `mark` and `reset` methods. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#read())() Reads a byte of uncompressed data. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#read(byte[],%20int,%20int))(byte\[\] b, int off, int len) Reads uncompressed data into an array of bytes. |
| synchronized void | [reset](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#reset())() Repositions this stream to the position at the time the `mark` method was last called on this input stream. |
| long | [skip](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#skip(long))(long n) Skips specified number of bytes of uncompressed data. |

From class [java.io.FilterInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html)

|---|---|
| int | [available](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#available())() Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. |
| void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#close())() Closes this input stream and releases any system resources associated with the stream. |
| synchronized void | [mark](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#mark(int))(int readlimit) Marks the current position in this input stream. |
| boolean | [markSupported](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#markSupported())() Tests if this input stream supports the `mark` and `reset` methods. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#read())() Reads the next byte of data from this input stream. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#read(byte[],%20int,%20int))(byte\[\] b, int off, int len) Reads up to `len` bytes of data from this input stream into an array of bytes. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#read(byte[]))(byte\[\] b) Reads up to `byte.length` bytes of data from this input stream into an array of bytes. |
| synchronized void | [reset](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#reset())() Repositions this stream to the position at the time the `mark` method was last called on this input stream. |
| long | [skip](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#skip(long))(long n) Skips over and discards `n` bytes of data from the input stream. |

From class [java.io.InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html)

|---|---|
| int | [available](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#available())() Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. |
| void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#close())() Closes this input stream and releases any system resources associated with the stream. |
| synchronized void | [mark](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#mark(int))(int readlimit) Marks the current position in this input stream. |
| boolean | [markSupported](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#markSupported())() Tests if this input stream supports the `mark` and `reset` methods. |
| abstract int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#read())() Reads the next byte of data from the input stream. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#read(byte[],%20int,%20int))(byte\[\] b, int off, int len) Reads up to `len` bytes of data from the input stream into an array of bytes. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#read(byte[]))(byte\[\] b) Reads some number of bytes from the input stream and stores them into the buffer array `b`. |
| synchronized void | [reset](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#reset())() Repositions this stream to the position at the time the `mark` method was last called on this input stream. |
| long | [skip](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#skip(long))(long n) Skips over and discards `n` bytes of data from this input stream. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [java.io.Closeable](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Closeable.html)

|---|---|
| abstract void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Closeable.html#close())() Closes this stream and releases any system resources associated with it. |

From interface [java.lang.AutoCloseable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AutoCloseable.html)

|---|---|
| abstract void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AutoCloseable.html#close())() Closes this resource, relinquishing any underlying resources. |

## Public Constructors

#### public
**JarInputStream**
([InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) in)

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](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error has occurred |
|---|---|

#### public
**JarInputStream**
([InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) in, boolean verify)

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](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error has occurred |
|---|---|

## Public Methods

#### public [Manifest](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/Manifest.html)
**getManifest**
()

Returns the `Manifest` for this JAR file, or
`null` if none.

##### Returns

- the `Manifest` for this JAR file, or `null` if none.

#### public [ZipEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipEntry.html)
**getNextEntry**
()

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.

##### Returns

- the next ZIP file entry, or null if there are no more entries

##### Throws

| [ZipException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipException.html) | if a ZIP file error has occurred |
| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error has occurred |
| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | if any of the jar file entries are incorrectly signed. |
|---|---|

#### public [JarEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarEntry.html)
**getNextJarEntry**
()

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.

##### Returns

- the next JAR file entry, or null if there are no more entries

##### Throws

| [ZipException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipException.html) | if a ZIP file error has occurred |
| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error has occurred |
| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | if any of the jar file entries are incorrectly signed. |
|---|---|

#### public int
**read**
(byte\[\] b, int off, int len)

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.

##### Parameters

| b | the buffer into which the data is read |
| off | the start offset in the destination array `b` |
| len | the maximum number of bytes to read |
|---|---|

##### Returns

- the actual number of bytes read, or -1 if the end of the entry is reached

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If `b` is `null`. |
| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) | If `off` is negative, `len` is negative, or `len` is greater than `b.length - off` |
| [ZipException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipException.html) | if a ZIP file error has occurred |
| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error has occurred |
| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | if any of the jar file entries are incorrectly signed. |
|---|---|

## Protected Methods

#### protected [ZipEntry](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipEntry.html)
**createZipEntry**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) 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`.

##### Parameters

| name | the name of the JAR/ZIP file entry |
|---|---|

##### Returns

- the `JarEntry` object just created