- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.util.zip.DeflaterOutputStream
-
- java.util.zip.ZipOutputStream
-
- java.util.jar.JarOutputStream
-
- All Implemented Interfaces:
-
Closeable
,Flushable
,AutoCloseable
public class JarOutputStream extends ZipOutputStream
JarOutputStream
类用于将JAR文件的内容写入任何输出流。 它扩展了类java.util.zip.ZipOutputStream
,支持写入可选的Manifest
条目。Manifest
可用于指定有关JAR文件及其条目的元信息。- 从以下版本开始:
- 1.2
- 另请参见:
-
Manifest
,ZipOutputStream
-
-
Field Summary
Fields Modifier and Type Field 描述 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
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
-
Fields inherited from class java.util.zip.DeflaterOutputStream
buf, def
-
Fields inherited from class java.io.FilterOutputStream
out
-
Fields inherited from class java.util.zip.ZipOutputStream
DEFLATED, STORED
-
-
构造方法摘要
构造方法 Constructor 描述 JarOutputStream(OutputStream out)
创建一个新的JarOutputStream
没有清单。JarOutputStream(OutputStream out, Manifest man)
创建一个新的JarOutputStream
与指定的Manifest
。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 void
putNextEntry(ZipEntry ze)
开始编写一个新的JAR文件条目,并将流定位到入口数据的开头。-
Methods inherited from class java.util.zip.DeflaterOutputStream
deflate, flush, write
-
Methods inherited from class java.io.FilterOutputStream
write
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class java.util.zip.ZipOutputStream
close, closeEntry, finish, setComment, setLevel, setMethod, write
-
-
-
-
字段详细信息
-
LOCSIG
public static final long LOCSIG
- 另请参见:
- Constant Field Values
-
EXTSIG
public static final long EXTSIG
- 另请参见:
- Constant Field Values
-
CENSIG
public static final long CENSIG
- 另请参见:
- Constant Field Values
-
ENDSIG
public static final long ENDSIG
- 另请参见:
- Constant Field Values
-
LOCHDR
public static final int LOCHDR
- 另请参见:
- Constant Field Values
-
EXTHDR
public static final int EXTHDR
- 另请参见:
- Constant Field Values
-
CENHDR
public static final int CENHDR
- 另请参见:
- Constant Field Values
-
ENDHDR
public static final int ENDHDR
- 另请参见:
- Constant Field Values
-
LOCVER
public static final int LOCVER
- 另请参见:
- Constant Field Values
-
LOCFLG
public static final int LOCFLG
- 另请参见:
- Constant Field Values
-
LOCHOW
public static final int LOCHOW
- 另请参见:
- Constant Field Values
-
LOCTIM
public static final int LOCTIM
- 另请参见:
- Constant Field Values
-
LOCCRC
public static final int LOCCRC
- 另请参见:
- Constant Field Values
-
LOCSIZ
public static final int LOCSIZ
- 另请参见:
- Constant Field Values
-
LOCLEN
public static final int LOCLEN
- 另请参见:
- Constant Field Values
-
LOCNAM
public static final int LOCNAM
- 另请参见:
- Constant Field Values
-
LOCEXT
public static final int LOCEXT
- 另请参见:
- Constant Field Values
-
EXTCRC
public static final int EXTCRC
- 另请参见:
- Constant Field Values
-
EXTSIZ
public static final int EXTSIZ
- 另请参见:
- Constant Field Values
-
EXTLEN
public static final int EXTLEN
- 另请参见:
- Constant Field Values
-
CENVEM
public static final int CENVEM
- 另请参见:
- Constant Field Values
-
CENVER
public static final int CENVER
- 另请参见:
- Constant Field Values
-
CENFLG
public static final int CENFLG
- 另请参见:
- Constant Field Values
-
CENHOW
public static final int CENHOW
- 另请参见:
- Constant Field Values
-
CENTIM
public static final int CENTIM
- 另请参见:
- Constant Field Values
-
CENCRC
public static final int CENCRC
- 另请参见:
- Constant Field Values
-
CENSIZ
public static final int CENSIZ
- 另请参见:
- Constant Field Values
-
CENLEN
public static final int CENLEN
- 另请参见:
- Constant Field Values
-
CENNAM
public static final int CENNAM
- 另请参见:
- Constant Field Values
-
CENEXT
public static final int CENEXT
- 另请参见:
- Constant Field Values
-
CENCOM
public static final int CENCOM
- 另请参见:
- Constant Field Values
-
CENDSK
public static final int CENDSK
- 另请参见:
- Constant Field Values
-
CENATT
public static final int CENATT
- 另请参见:
- Constant Field Values
-
CENATX
public static final int CENATX
- 另请参见:
- Constant Field Values
-
CENOFF
public static final int CENOFF
- 另请参见:
- Constant Field Values
-
ENDSUB
public static final int ENDSUB
- 另请参见:
- Constant Field Values
-
ENDTOT
public static final int ENDTOT
- 另请参见:
- Constant Field Values
-
ENDSIZ
public static final int ENDSIZ
- 另请参见:
- Constant Field Values
-
ENDOFF
public static final int ENDOFF
- 另请参见:
- Constant Field Values
-
ENDCOM
public static final int ENDCOM
- 另请参见:
- Constant Field Values
-
-
构造方法详细信息
-
JarOutputStream
public JarOutputStream(OutputStream out, Manifest man) throws IOException
创建一个新的JarOutputStream
与指定的Manifest
。 清单被写入输出流的第一个条目。- 参数
-
out
- 实际的输出流 -
man
- 可选Manifest
- 异常
-
IOException
- 如果发生I / O错误
-
JarOutputStream
public JarOutputStream(OutputStream out) throws IOException
创建一个新的JarOutputStream
没有清单。- 参数
-
out
- 实际的输出流 - 异常
-
IOException
- 如果发生I / O错误
-
-
方法详细信息
-
putNextEntry
public void putNextEntry(ZipEntry ze) throws IOException
开始编写一个新的JAR文件条目,并将流定位到入口数据的开头。 此方法也将关闭任何以前的条目。 如果没有为条目指定压缩方法,将使用默认压缩方法。 如果条目没有设置修改时间,将使用当前时间。- 重写:
-
putNextEntry
在ZipOutputStream
- 参数
-
ze
- 要写入的ZIP / JAR条目 - 异常
-
ZipException
- 如果发生ZIP错误 -
IOException
- 如果发生I / O错误
-
-