java.util.zip.ZipEntry類用於表示ZIP檔條目。
類聲明
以下是java.util.zip.ZipEntry類的聲明 -
public class ZipEntry
extends Object
implements Cloneable
字段
以下是java.util.zip.ZipEntry類的字段 -
protected byte[] buf- 用於寫入未壓縮數據的輸出緩衝區。protected Inflater inf- 這個流的解壓縮器。- `static int CENATT``
static int CENATXstatic int CENCOMstatic int CENCRCstatic int CENDSKstatic int CENEXTstatic int CENFLGstatic int CENHDRstatic int CENHOWstatic int CENLENstatic int CENNAMstatic int CENOFFstatic long CENSIGstatic int CENSIZstatic int CENTIMstatic int CENVEMstatic int CENVERstatic int DEFLATED- 壓縮(壓縮)條目的壓縮方法。static int ENDCOMstatic int ENDHDRstatic int ENDOFFstatic long ENDSIGstatic int ENDSIZstatic int ENDSUBstatic int ENDTOTstatic int EXTCRCstatic int EXTHDRstatic int EXTLENstatic long EXTSIGstatic int EXTSIZstatic int LOCCRCstatic int LOCEXTstatic int LOCFLGstatic int LOCHDRstatic int LOCHOWstatic int LOCLENstatic int LOCNAMstatic long LOCSIGstatic int LOCSIZstatic int LOCTIMstatic int LOCVERstatic int STORED- 未壓縮條目的壓縮方法。
構造函數
| 編號 | 構造函數 | 描述 |
|---|---|---|
| 1 | ZipEntry(String name) |
使用指定的名稱創建一個新的zip條目。 |
| 2 | ZipEntry(ZipEntry e) |
創建一個新的zip條目,其中包含從指定的zip條目中獲取的字段。 |
類方法
| 編號 | 方法 | 描述 |
|---|---|---|
| 1 | Object clone() | 返回此條目的副本。 |
| 2 | String getComment() | 返回條目的注釋字串;如果沒有,則返回null。 |
| 3 | long getCompressedSize() | 返回壓縮條目數據的大小,如果未知,則返回-1。 |
| 4 | long getCrc() | 返回未壓縮條目數據的CRC-32校驗和,如果未知,則返回-1。 |
| 5 | byte[] getExtra() | 返回條目的額外字段數據,如果沒有,則返回null。 |
| 6 | int getMethod() | 返回條目的壓縮方法,如果未指定,則返回-1。 |
| 7 | String getName() | 返回條目的名稱。 |
| 8 | long getSize() | 返回條目數據的未壓縮大小,如果未知,則返回-1。 |
| 9 | long getTime() | 返回條目的修改時間,如果未指定,則返回-1。 |
| 10 | int hashCode() | 返回此條目的哈希碼值。 |
| 11 | boolean isDirectory() | 如果這是一個目錄條目,則返回true。 |
| 12 | void setComment(String comment) | 設置條目的可選注釋字串。 |
| 13 | void setCrc(long crc) | 設置未壓縮條目數據的CRC-32校驗和。 |
| 14 | void setExtra(byte[] extra) | 為條目設置可選的額外字段數據。 |
| 15 | void setMethod(int method) | 設置條目的壓縮方法。 |
| 16 | void setSize(long size) | 設置條目數據的未壓縮大小。 |
| 17 | void setTime(long time) | 設置條目的修改時間。 |
| 18 | String toString() | 返回ZIP條目的字串表示形式。 |
繼承的方法
這個類繼承了以下類的方法 -
java.io.FilterOutputStreamjava.lang.Object
