Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/java/util/zip/ZipEntry#constants) \| [Ctors](https://developer.android.com/reference/java/util/zip/ZipEntry#pubctors) \| [Methods](https://developer.android.com/reference/java/util/zip/ZipEntry#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/util/zip/ZipEntry#inhmethods)

# ZipEntry

` public class ZipEntry `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/java/lang/Cloneable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.util.zip.ZipEntry |

Known direct subclasses [JarEntry](https://developer.android.com/reference/java/util/jar/JarEntry) [JarEntry](https://developer.android.com/reference/java/util/jar/JarEntry) This class is used to represent a JAR file entry.   

*** ** * ** ***

This class is used to represent a ZIP file entry.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENATT` Central directory (CEN) header internal file attributes field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENATX` Central directory (CEN) header external file attributes field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENCOM` Central directory (CEN) header comment length field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENCRC` Central directory (CEN) header uncompressed file crc-32 value field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENDSK` Central directory (CEN) header disk number start field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENEXT` Central directory (CEN) header extra field length field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENFLG` Central directory (CEN) header encrypt, decrypt flags field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENHDR` Central directory (CEN) header size in bytes (including signature). |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENHOW` Central directory (CEN) header compression method field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENLEN` Central directory (CEN) header uncompressed size field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENNAM` Central directory (CEN) header filename length field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENOFF` Central directory (CEN) header LOC header offset field offset. |
| `long` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENSIG` Central directory (CEN) header signature. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENSIZ` Central directory (CEN) header compressed size field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENTIM` Central directory (CEN) header modification time field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENVEM` Central directory (CEN) header version made by field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#CENVER` Central directory (CEN) header version needed to extract field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#DEFLATED` Compression method for compressed (deflated) entries. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#ENDCOM` End of central directory (END) header zip file comment length field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#ENDHDR` End of central directory (END) header size in bytes (including signature). |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#ENDOFF` End of central directory (END) header offset for the first CEN header field offset. |
| `long` | `https://developer.android.com/reference/java/util/zip/ZipEntry#ENDSIG` End of central directory (END) header signature. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#ENDSIZ` End of central directory (END) header central directory size in bytes field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#ENDSUB` End of central directory (END) header number of entries on this disk field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#ENDTOT` End of central directory (END) header total number of entries field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#EXTCRC` Extra local (EXT) header uncompressed file crc-32 value field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#EXTHDR` Extra local (EXT) header size in bytes (including signature). |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#EXTLEN` Extra local (EXT) header uncompressed size field offset. |
| `long` | `https://developer.android.com/reference/java/util/zip/ZipEntry#EXTSIG` Extra local (EXT) header signature. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#EXTSIZ` Extra local (EXT) header compressed size field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#LOCCRC` Local file (LOC) header uncompressed file crc-32 value field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#LOCEXT` Local file (LOC) header extra field length field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#LOCFLG` Local file (LOC) header general purpose bit flag field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#LOCHDR` Local file (LOC) header size in bytes (including signature). |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#LOCHOW` Local file (LOC) header compression method field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#LOCLEN` Local file (LOC) header uncompressed size field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#LOCNAM` Local file (LOC) header filename length field offset. |
| `long` | `https://developer.android.com/reference/java/util/zip/ZipEntry#LOCSIG` Local file (LOC) header signature. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#LOCSIZ` Local file (LOC) header compressed size field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#LOCTIM` Local file (LOC) header modification time field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#LOCVER` Local file (LOC) header version needed to extract field offset. |
| `int` | `https://developer.android.com/reference/java/util/zip/ZipEntry#STORED` Compression method for uncompressed entries. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/java/util/zip/ZipEntry#ZipEntry(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Creates a new zip entry with the specified name. |
| ` https://developer.android.com/reference/java/util/zip/ZipEntry#ZipEntry(java.util.zip.ZipEntry)(https://developer.android.com/reference/java/util/zip/ZipEntry e) ` Creates a new zip entry with fields taken from the specified zip entry. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#clone()() ` Returns a copy of this entry. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getComment()() ` Returns the comment string for the entry. |
| ` long` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getCompressedSize()() ` Returns the size of the compressed entry data. |
| ` long` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getCrc()() ` Returns the CRC-32 checksum of the uncompressed entry data. |
| ` https://developer.android.com/reference/java/nio/file/attribute/FileTime` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getCreationTime()() ` Returns the creation time of the entry. |
| ` byte[]` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getExtra()() ` Returns the extra field data for the entry. |
| ` https://developer.android.com/reference/java/nio/file/attribute/FileTime` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getLastAccessTime()() ` Returns the last access time of the entry. |
| ` https://developer.android.com/reference/java/nio/file/attribute/FileTime` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getLastModifiedTime()() ` Returns the last modification time of the entry. |
| ` int` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getMethod()() ` Returns the compression method of the entry. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getName()() ` Returns the name of the entry. |
| ` long` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getSize()() ` Returns the uncompressed size of the entry data. |
| ` long` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getTime()() ` Returns the last modification time of the entry. |
| ` https://developer.android.com/reference/java/time/LocalDateTime` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#getTimeLocal()() ` Returns the last modification time of the entry in local date-time. |
| ` int` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#hashCode()() ` Returns the hash code value for this entry. |
| ` boolean` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#isDirectory()() ` Returns true if this is a directory entry. |
| ` void` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#setComment(java.lang.String)(https://developer.android.com/reference/java/lang/String comment) ` Sets the optional comment string for the entry. |
| ` void` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#setCompressedSize(long)(long csize) ` Sets the size of the compressed entry data. |
| ` void` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#setCrc(long)(long crc) ` Sets the CRC-32 checksum of the uncompressed entry data. |
| ` https://developer.android.com/reference/java/util/zip/ZipEntry` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#setCreationTime(java.nio.file.attribute.FileTime)(https://developer.android.com/reference/java/nio/file/attribute/FileTime time) ` Sets the creation time of the entry. |
| ` void` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#setExtra(byte[])(byte[] extra) ` Sets the optional extra field data for the entry. |
| ` https://developer.android.com/reference/java/util/zip/ZipEntry` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#setLastAccessTime(java.nio.file.attribute.FileTime)(https://developer.android.com/reference/java/nio/file/attribute/FileTime time) ` Sets the last access time of the entry. |
| ` https://developer.android.com/reference/java/util/zip/ZipEntry` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#setLastModifiedTime(java.nio.file.attribute.FileTime)(https://developer.android.com/reference/java/nio/file/attribute/FileTime time) ` Sets the last modification time of the entry. |
| ` void` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#setMethod(int)(int method) ` Sets the compression method for the entry. |
| ` void` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#setSize(long)(long size) ` Sets the uncompressed size of the entry data. |
| ` void` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#setTime(long)(long time) ` Sets the last modification time of the entry. |
| ` void` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#setTimeLocal(java.time.LocalDateTime)(https://developer.android.com/reference/java/time/LocalDateTime time) ` Sets the last modification time of the entry in local date-time. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/util/zip/ZipEntry#toString()() ` Returns a string representation of the ZIP entry. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### CENATT

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENATT
```

Central directory (CEN) header internal file attributes field offset.

<br />

Constant Value: 36 (0x00000024)

### CENATX

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENATX
```

Central directory (CEN) header external file attributes field offset.

<br />

Constant Value: 38 (0x00000026)

### CENCOM

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENCOM
```

Central directory (CEN) header comment length field offset.

<br />

Constant Value: 32 (0x00000020)

### CENCRC

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENCRC
```

Central directory (CEN) header uncompressed file crc-32 value field offset.

<br />

Constant Value: 16 (0x00000010)

### CENDSK

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENDSK
```

Central directory (CEN) header disk number start field offset.

<br />

Constant Value: 34 (0x00000022)

### CENEXT

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENEXT
```

Central directory (CEN) header extra field length field offset.

<br />

Constant Value: 30 (0x0000001e)

### CENFLG

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENFLG
```

Central directory (CEN) header encrypt, decrypt flags field offset.

<br />

Constant Value: 8 (0x00000008)

### CENHDR

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENHDR
```

Central directory (CEN) header size in bytes (including signature).

<br />

Constant Value: 46 (0x0000002e)

### CENHOW

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENHOW
```

Central directory (CEN) header compression method field offset.

<br />

Constant Value: 10 (0x0000000a)

### CENLEN

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENLEN
```

Central directory (CEN) header uncompressed size field offset.

<br />

Constant Value: 24 (0x00000018)

### CENNAM

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENNAM
```

Central directory (CEN) header filename length field offset.

<br />

Constant Value: 28 (0x0000001c)

### CENOFF

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENOFF
```

Central directory (CEN) header LOC header offset field offset.

<br />

Constant Value: 42 (0x0000002a)

### CENSIG

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final long CENSIG
```

Central directory (CEN) header signature.

<br />

Constant Value: 33639248 (0x0000000002014b50)

### CENSIZ

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENSIZ
```

Central directory (CEN) header compressed size field offset.

<br />

Constant Value: 20 (0x00000014)

### CENTIM

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENTIM
```

Central directory (CEN) header modification time field offset.

<br />

Constant Value: 12 (0x0000000c)

### CENVEM

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENVEM
```

Central directory (CEN) header version made by field offset.

<br />

Constant Value: 4 (0x00000004)

### CENVER

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int CENVER
```

Central directory (CEN) header version needed to extract field offset.

<br />

Constant Value: 6 (0x00000006)

### DEFLATED

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DEFLATED
```

Compression method for compressed (deflated) entries.

<br />

Constant Value: 8 (0x00000008)

### ENDCOM

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ENDCOM
```

End of central directory (END) header zip file comment length field offset.

<br />

Constant Value: 20 (0x00000014)

### ENDHDR

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ENDHDR
```

End of central directory (END) header size in bytes (including signature).

<br />

Constant Value: 22 (0x00000016)

### ENDOFF

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ENDOFF
```

End of central directory (END) header offset for the first CEN header field offset.

<br />

Constant Value: 16 (0x00000010)

### ENDSIG

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final long ENDSIG
```

End of central directory (END) header signature.

<br />

Constant Value: 101010256 (0x0000000006054b50)

### ENDSIZ

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ENDSIZ
```

End of central directory (END) header central directory size in bytes field offset.

<br />

Constant Value: 12 (0x0000000c)

### ENDSUB

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ENDSUB
```

End of central directory (END) header number of entries on this disk field offset.

<br />

Constant Value: 8 (0x00000008)

### ENDTOT

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ENDTOT
```

End of central directory (END) header total number of entries field offset.

<br />

Constant Value: 10 (0x0000000a)

### EXTCRC

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EXTCRC
```

Extra local (EXT) header uncompressed file crc-32 value field offset.

<br />

Constant Value: 4 (0x00000004)

### EXTHDR

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EXTHDR
```

Extra local (EXT) header size in bytes (including signature).

<br />

Constant Value: 16 (0x00000010)

### EXTLEN

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EXTLEN
```

Extra local (EXT) header uncompressed size field offset.

<br />

Constant Value: 12 (0x0000000c)

### EXTSIG

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final long EXTSIG
```

Extra local (EXT) header signature.

<br />

Constant Value: 134695760 (0x0000000008074b50)

### EXTSIZ

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EXTSIZ
```

Extra local (EXT) header compressed size field offset.

<br />

Constant Value: 8 (0x00000008)

### LOCCRC

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LOCCRC
```

Local file (LOC) header uncompressed file crc-32 value field offset.

<br />

Constant Value: 14 (0x0000000e)

### LOCEXT

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LOCEXT
```

Local file (LOC) header extra field length field offset.

<br />

Constant Value: 28 (0x0000001c)

### LOCFLG

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LOCFLG
```

Local file (LOC) header general purpose bit flag field offset.

<br />

Constant Value: 6 (0x00000006)

### LOCHDR

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LOCHDR
```

Local file (LOC) header size in bytes (including signature).

<br />

Constant Value: 30 (0x0000001e)

### LOCHOW

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LOCHOW
```

Local file (LOC) header compression method field offset.

<br />

Constant Value: 8 (0x00000008)

### LOCLEN

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LOCLEN
```

Local file (LOC) header uncompressed size field offset.

<br />

Constant Value: 22 (0x00000016)

### LOCNAM

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LOCNAM
```

Local file (LOC) header filename length field offset.

<br />

Constant Value: 26 (0x0000001a)

### LOCSIG

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final long LOCSIG
```

Local file (LOC) header signature.

<br />

Constant Value: 67324752 (0x0000000004034b50)

### LOCSIZ

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LOCSIZ
```

Local file (LOC) header compressed size field offset.

<br />

Constant Value: 18 (0x00000012)

### LOCTIM

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LOCTIM
```

Local file (LOC) header modification time field offset.

<br />

Constant Value: 10 (0x0000000a)

### LOCVER

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LOCVER
```

Local file (LOC) header version needed to extract field offset.

<br />

Constant Value: 4 (0x00000004)

### STORED

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STORED
```

Compression method for uncompressed entries.

<br />

Constant Value: 0 (0x00000000)

## Public constructors

### ZipEntry

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ZipEntry (String name)
```

Creates a new zip entry with the specified name.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The entry name <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the entry name is longer than 0xFFFF bytes |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the entry name is null |

### ZipEntry

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ZipEntry (ZipEntry e)
```

Creates a new zip entry with fields taken from the specified zip entry.

<br />

| Parameters ||
|---|---|
| `e` | `ZipEntry`: A zip Entry object <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the entry object is null |

## Public methods

### clone

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Object clone ()
```

Returns a copy of this entry.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | a clone of this instance. <br /> |

### getComment

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getComment ()
```

Returns the comment string for the entry.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the comment string for the entry, or null if none <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#setComment(java.lang.String)`

### getCompressedSize

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getCompressedSize ()
```

Returns the size of the compressed entry data.

In the case of a stored entry, the compressed size will be the same as the uncompressed size of the entry.

<br />

| Returns ||
|---|---|
| `long` | the size of the compressed entry data, or -1 if not known <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#setCompressedSize(long)`

### getCrc

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getCrc ()
```

Returns the CRC-32 checksum of the uncompressed entry data.

<br />

| Returns ||
|---|---|
| `long` | the CRC-32 checksum of the uncompressed entry data, or -1 if not known <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#setCrc(long)`

### getCreationTime

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FileTime getCreationTime ()
```

Returns the creation time of the entry.

The creation time is from the extended timestamp fields of entry's `optional extra data` when read from a ZIP file or ZIP file formatted stream.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/attribute/FileTime` | the creation time of the entry, null if not specified <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#setCreationTime(java.nio.file.attribute.FileTime)`

### getExtra

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public byte[] getExtra ()
```

Returns the extra field data for the entry.

<br />

| Returns ||
|---|---|
| `byte[]` | the extra field data for the entry, or null if none <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#setExtra(byte[])`

### getLastAccessTime

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FileTime getLastAccessTime ()
```

Returns the last access time of the entry.

The last access time is from the extended timestamp fields of entry's `optional extra data` when read from a ZIP file or ZIP file formatted stream.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/attribute/FileTime` | The last access time of the entry, null if not specified <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#setLastAccessTime(java.nio.file.attribute.FileTime)`

### getLastModifiedTime

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FileTime getLastModifiedTime ()
```

Returns the last modification time of the entry.

If the entry is read from a ZIP file or ZIP file formatted input stream, this is the last modification time from the zip file entry's `optional extra data` if the extended timestamp fields are present. Otherwise the last modification time is read from the entry's `date and time fields`, the `https://developer.android.com/reference/java/util/TimeZone#getDefault()` is used to convert the standard MS-DOS formatted date and time to the epoch time.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/attribute/FileTime` | The last modification time of the entry, null if not specified <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#setLastModifiedTime(java.nio.file.attribute.FileTime)`

### getMethod

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMethod ()
```

Returns the compression method of the entry.

<br />

| Returns ||
|---|---|
| `int` | the compression method of the entry, or -1 if not specified <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#setMethod(int)`

### getName

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getName ()
```

Returns the name of the entry.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the name of the entry <br /> |

### getSize

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getSize ()
```

Returns the uncompressed size of the entry data.

<br />

| Returns ||
|---|---|
| `long` | the uncompressed size of the entry data, or -1 if not known <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#setSize(long)`

### getTime

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getTime ()
```

Returns the last modification time of the entry.

If the entry is read from a ZIP file or ZIP file formatted input stream, this is the last modification time from the `date and time fields` of the zip file entry. The `https://developer.android.com/reference/java/util/TimeZone#getDefault()` is used to convert the standard MS-DOS formatted date and time to the epoch time.

<br />

| Returns ||
|---|---|
| `long` | The last modification time of the entry in milliseconds since the epoch, or -1 if not specified <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#setTime(long)`
- `https://developer.android.com/reference/java/util/zip/ZipEntry#setLastModifiedTime(java.nio.file.attribute.FileTime)`

### getTimeLocal

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public LocalDateTime getTimeLocal ()
```

Returns the last modification time of the entry in local date-time.

If the entry is read from a ZIP file or ZIP file formatted input stream, this is the last modification time from the zip file entry's `optional extra data` if the extended timestamp fields are present. Otherwise, the last modification time is read from entry's standard MS-DOS formatted `date and time fields`.

The `https://developer.android.com/reference/java/time/ZoneId#systemDefault()` is used to convert the UTC time to local date-time.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/LocalDateTime` | The last modification time of the entry in local date-time <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#setTimeLocal(java.time.LocalDateTime)`

### hashCode

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int hashCode ()
```

Returns the hash code value for this entry.

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### isDirectory

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isDirectory ()
```

Returns true if this is a directory entry. A directory entry is defined to be one whose name ends with a '/'.

<br />

| Returns ||
|---|---|
| `boolean` | true if this is a directory entry <br /> |

### setComment

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setComment (String comment)
```

Sets the optional comment string for the entry.

ZIP entry comments have maximum length of 0xffff. If the length of the specified comment string is greater than 0xFFFF bytes after encoding, only the first 0xFFFF bytes are output to the ZIP file entry.

<br />

| Parameters ||
|---|---|
| `comment` | `String`: the comment string <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#getComment()`

### setCompressedSize

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setCompressedSize (long csize)
```

Sets the size of the compressed entry data.

<br />

| Parameters ||
|---|---|
| `csize` | `long`: the compressed size to set <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#getCompressedSize()`

### setCrc

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setCrc (long crc)
```

Sets the CRC-32 checksum of the uncompressed entry data.

<br />

| Parameters ||
|---|---|
| `crc` | `long`: the CRC-32 value <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the specified CRC-32 value is less than 0 or greater than 0xFFFFFFFF |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#getCrc()`

### setCreationTime

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ZipEntry setCreationTime (FileTime time)
```

Sets the creation time of the entry.

If set, the creation time will be stored into the extended timestamp fields of entry's `optional extra data`, when output to a ZIP file or ZIP file formatted stream.

<br />

| Parameters ||
|---|---|
| `time` | `FileTime`: The creation time of the entry <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/zip/ZipEntry` | This zip entry <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the `time` is null |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#getCreationTime()`

### setExtra

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setExtra (byte[] extra)
```

Sets the optional extra field data for the entry.

Invoking this method may change this entry's last modification time, last access time and creation time, if the `extra` field data includes the extensible timestamp fields, such as `NTFS tag 0x0001` or `Info-ZIP Extended Timestamp`, as specified in [Info-ZIP Application Note 970311](http://www.info-zip.org/doc/appnote-19970311-iz.zip).

<br />

| Parameters ||
|---|---|
| `extra` | `byte`: The extra field data bytes <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the length of the specified extra field data is greater than 0xFFFF bytes |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#getExtra()`

### setLastAccessTime

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ZipEntry setLastAccessTime (FileTime time)
```

Sets the last access time of the entry.

If set, the last access time will be stored into the extended timestamp fields of entry's `optional extra data`, when output to a ZIP file or ZIP file formatted stream.

<br />

| Parameters ||
|---|---|
| `time` | `FileTime`: The last access time of the entry <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/zip/ZipEntry` | This zip entry <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the `time` is null |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#getLastAccessTime()`

### setLastModifiedTime

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ZipEntry setLastModifiedTime (FileTime time)
```

Sets the last modification time of the entry.

When output to a ZIP file or ZIP file formatted output stream the last modification time set by this method will be stored into zip file entry's `date and time fields` in `standard MS-DOS date and time format`), and the extended timestamp fields in `optional extra data` in UTC time.

<br />

| Parameters ||
|---|---|
| `time` | `FileTime`: The last modification time of the entry <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/zip/ZipEntry` | This zip entry <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the `time` is null |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#getLastModifiedTime()`

### setMethod

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setMethod (int method)
```

Sets the compression method for the entry.

<br />

| Parameters ||
|---|---|
| `method` | `int`: the compression method, either STORED or DEFLATED <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the specified compression method is invalid |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#getMethod()`

### setSize

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setSize (long size)
```

Sets the uncompressed size of the entry data.

<br />

| Parameters ||
|---|---|
| `size` | `long`: the uncompressed size in bytes <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the specified size is less than 0, is greater than 0xFFFFFFFF when [ZIP64 format](https://developer.android.com/reference/java/util/zip/package-summary#zip64) is not supported, or is less than 0 when ZIP64 is supported |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#getSize()`

### setTime

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTime (long time)
```

Sets the last modification time of the entry.

If the entry is output to a ZIP file or ZIP file formatted output stream the last modification time set by this method will be stored into the `date and time fields` of the zip file entry and encoded in standard `MS-DOS date and time format`. The `https://developer.android.com/reference/java/util/TimeZone#getDefault()` is used to convert the epoch time to the MS-DOS data and time.

<br />

| Parameters ||
|---|---|
| `time` | `long`: The last modification time of the entry in milliseconds since the epoch <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#getTime()`
- `https://developer.android.com/reference/java/util/zip/ZipEntry#getLastModifiedTime()`

### setTimeLocal

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTimeLocal (LocalDateTime time)
```

Sets the last modification time of the entry in local date-time.

If the entry is output to a ZIP file or ZIP file formatted output stream the last modification time set by this method will be stored into the `date and time fields` of the zip file entry and encoded in standard `MS-DOS date and time format`. If the date-time set is out of the range of the standard `MS-DOS date and time format`, the time will also be stored into zip file entry's extended timestamp fields in `optional extra data` in UTC time. The `https://developer.android.com/reference/java/time/ZoneId#systemDefault()` is used to convert the local date-time to UTC time.

`LocalDateTime` uses a precision of nanoseconds, whereas this class uses a precision of milliseconds. The conversion will truncate any excess precision information as though the amount in nanoseconds was subject to integer division by one million.

<br />

| Parameters ||
|---|---|
| `time` | `LocalDateTime`: The last modification time of the entry in local date-time <br /> |

**See also:**

- `https://developer.android.com/reference/java/util/zip/ZipEntry#getTimeLocal()`

### toString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the ZIP entry.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |