java.util.zip.ZipEntry類
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 CENATX -
static int CENCOM -
static int CENCRC -
static int CENDSK -
static int CENEXT -
static int CENFLG -
static int CENHDR -
static int CENHOW -
static int CENLEN -
static int CENNAM -
static int CENOFF -
static long CENSIG -
static int CENSIZ -
static int CENTIM -
static int CENVEM -
static int CENVER -
static int DEFLATED- 壓縮(壓縮)條目的壓縮方法。 -
static int ENDCOM -
static int ENDHDR -
static int ENDOFF -
static long ENDSIG -
static int ENDSIZ -
static int ENDSUB -
static int ENDTOT -
static int EXTCRC -
static int EXTHDR -
static int EXTLEN -
static long EXTSIG -
static int EXTSIZ -
static int LOCCRC -
static int LOCEXT -
static int LOCFLG -
static int LOCHDR -
static int LOCHOW -
static int LOCLEN -
static int LOCNAM -
static long LOCSIG -
static int LOCSIZ -
static int LOCTIM -
static int LOCVER -
static 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.FilterOutputStream -
java.lang.Object