java.util.jar
类 JarOutputStream
java.lang.Object
  
java.io.OutputStream
      
java.io.FilterOutputStream
          
java.util.zip.DeflaterOutputStream
              
java.util.zip.ZipOutputStream
                  
java.util.jar.JarOutputStream
- 所有已实现的接口: 
 - Closeable, Flushable
 
public class JarOutputStream
- extends ZipOutputStream
 
JarOutputStream 类用于向任何输出流写入 JAR 文件内容。它扩展了 java.util.zip.ZipOutputStream 类,使之支持编写可选的 Manifest 条目。Manifest 可用于指定有关 JAR 文件及其条目的元信息。
- 从以下版本开始:
 
  - 1.2
 
- 另请参见:
 Manifest, 
ZipOutputStream
 
 
 
 
 
 
 
 
 
| 从类 java.lang.Object 继承的方法 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
LOCSIG
public static final long LOCSIG
- 另请参见:
 - 常量字段值
 
EXTSIG
public static final long EXTSIG
- 另请参见:
 - 常量字段值
 
CENSIG
public static final long CENSIG
- 另请参见:
 - 常量字段值
 
ENDSIG
public static final long ENDSIG
- 另请参见:
 - 常量字段值
 
LOCHDR
public static final int LOCHDR
- 另请参见:
 - 常量字段值
 
EXTHDR
public static final int EXTHDR
- 另请参见:
 - 常量字段值
 
CENHDR
public static final int CENHDR
- 另请参见:
 - 常量字段值
 
ENDHDR
public static final int ENDHDR
- 另请参见:
 - 常量字段值
 
LOCVER
public static final int LOCVER
- 另请参见:
 - 常量字段值
 
LOCFLG
public static final int LOCFLG
- 另请参见:
 - 常量字段值
 
LOCHOW
public static final int LOCHOW
- 另请参见:
 - 常量字段值
 
LOCTIM
public static final int LOCTIM
- 另请参见:
 - 常量字段值
 
LOCCRC
public static final int LOCCRC
- 另请参见:
 - 常量字段值
 
LOCSIZ
public static final int LOCSIZ
- 另请参见:
 - 常量字段值
 
LOCLEN
public static final int LOCLEN
- 另请参见:
 - 常量字段值
 
LOCNAM
public static final int LOCNAM
- 另请参见:
 - 常量字段值
 
LOCEXT
public static final int LOCEXT
- 另请参见:
 - 常量字段值
 
EXTCRC
public static final int EXTCRC
- 另请参见:
 - 常量字段值
 
EXTSIZ
public static final int EXTSIZ
- 另请参见:
 - 常量字段值
 
EXTLEN
public static final int EXTLEN
- 另请参见:
 - 常量字段值
 
CENVEM
public static final int CENVEM
- 另请参见:
 - 常量字段值
 
CENVER
public static final int CENVER
- 另请参见:
 - 常量字段值
 
CENFLG
public static final int CENFLG
- 另请参见:
 - 常量字段值
 
CENHOW
public static final int CENHOW
- 另请参见:
 - 常量字段值
 
CENTIM
public static final int CENTIM
- 另请参见:
 - 常量字段值
 
CENCRC
public static final int CENCRC
- 另请参见:
 - 常量字段值
 
CENSIZ
public static final int CENSIZ
- 另请参见:
 - 常量字段值
 
CENLEN
public static final int CENLEN
- 另请参见:
 - 常量字段值
 
CENNAM
public static final int CENNAM
- 另请参见:
 - 常量字段值
 
CENEXT
public static final int CENEXT
- 另请参见:
 - 常量字段值
 
CENCOM
public static final int CENCOM
- 另请参见:
 - 常量字段值
 
CENDSK
public static final int CENDSK
- 另请参见:
 - 常量字段值
 
CENATT
public static final int CENATT
- 另请参见:
 - 常量字段值
 
CENATX
public static final int CENATX
- 另请参见:
 - 常量字段值
 
CENOFF
public static final int CENOFF
- 另请参见:
 - 常量字段值
 
ENDSUB
public static final int ENDSUB
- 另请参见:
 - 常量字段值
 
ENDTOT
public static final int ENDTOT
- 另请参见:
 - 常量字段值
 
ENDSIZ
public static final int ENDSIZ
- 另请参见:
 - 常量字段值
 
ENDOFF
public static final int ENDOFF
- 另请参见:
 - 常量字段值
 
ENDCOM
public static final int ENDCOM
- 另请参见:
 - 常量字段值
 
JarOutputStream
public JarOutputStream(OutputStream out,
                       Manifest man)
                throws IOException
- 使用指定的 
Manifest 创建新的 JarOutputStream。清单作为输出流的第一个条目被写入。
- 参数:
 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 文件条目,并将流定位到条目数据的开始处。此方法还将关闭以前的任何条目。如果没有指定条目的压缩方法,则使用默认压缩方法。如果条目没有设置修改时间,则使用当前时间。
- 覆盖:
 - 类 
ZipOutputStream 中的 putNextEntry 
 
- 参数:
 ze - 要写入的 ZIP/JAR 条目
- 抛出:
 ZipException - 如果发生 ZIP 错误
IOException - 如果发生 I/O 错误
 
 
提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。 版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。