📜  java.util.zip-ZipFile类

📅  最后修改于: 2020-11-14 10:54:46             🧑  作者: Mango


介绍

java.util.zip.ZipFile类用于从zip文件读取条目。

类声明

以下是java.util.zip.ZipFile类的声明-

public class ZipFile
   extends Object
      implements Closeable

领域

以下是java.util.zip.ZipFile类的字段-

  • 静态int CENATT

  • 静态int CENATX

  • 静态int CENCOM

  • 静态int CENCRC

  • static int CENDSK

  • 静态int CENEXT

  • 静态int CENFLG

  • 静态int CENHDR

  • 静态int CENHOW

  • 静态整数CENLEN

  • 静态int CENNAM

  • 静态int CENOFF

  • 静态长CENSIG

  • 静态int CENSIZ

  • 静态int CENTIM

  • static int CENVEM

  • static int CENVER

  • 静态int ENDCOM

  • 静态int ENDHDR

  • 静态int ENDOFF

  • 静态长ENDSIG

  • 静态整数ENDSIZ

  • 静态int ENDSUB

  • 静态int ENDTOT

  • 静态int EXTCRC

  • 静态诠释EXTHDR

  • 静态整数EXTLEN

  • 静态长EXTSIG

  • 静态整数EXTSIZ

  • 静态int LOCCRC

  • 静态整数LOCEXT

  • 静态int LOCFLG

  • 静态int LOCHDR

  • 静态int LOCHOW

  • 静态整数LOCLEN

  • 静态int LOCNAM

  • 静态长LOCSIG

  • 静态int LOCSIZ

  • 静态整数LOCTIM

  • 静态整数LOCVER

  • static int OPEN_DELETE-模式标志以打开一个zip文件并将其标记为删除。

  • static int OPEN_READ-模式标志以打开一个zip文件进行读取。

建设者

Sr.No. Constructor & Description
1

ZipFile(File file)

Opens a ZIP file for reading given the specified File object.

2

ZipFile(File file, Charset charset)

Opens a ZIP file for reading given the specified File object.

3

ZipFile(File file, int mode)

Opens a new ZipFile to read from the specified File object in the specified mode.

4

ZipFile(File file, int mode, Charset charset)

Opens a new ZipFile to read from the specified File object in the specified mode.

5

ZipFile(String name)

Opens a zip file for reading.

6

ZipFile(String name, Charset charset)

Opens a zip file for reading.

类方法

Sr.No. Method & Description
1 void close()

Closes the ZIP file.

2 Enumeration entries()

Returns an enumeration of the ZIP file entries.

3 String getComment()

Returns the zip file comment, or null if none.

4 ZipEntry getEntry(String name)

Returns the zip file entry for the specified name, or null if not found.

5 InputStream getInputStream(ZipEntry entry)

Returns an input stream for reading the contents of the specified zip file entry.

6 String getName()

Returns the path name of the ZIP file.

7 int size()

Returns the number of entries in the ZIP file.

方法继承

此类从以下类继承方法-

  • Java.lang.Object

打印