Most visited

Recently visited

Added in API level 1

JarOutputStream

public class JarOutputStream
extends ZipOutputStream

java.lang.Object
   ↳ java.io.OutputStream
     ↳ java.io.FilterOutputStream
       ↳ java.util.zip.DeflaterOutputStream
         ↳ java.util.zip.ZipOutputStream
           ↳ java.util.jar.JarOutputStream


JarOutputStream类用于将JAR文件的内容写入任何输出流。 它扩展了类java.util.zip.ZipOutputStream ,支持编写可选的Manifest条目。 Manifest可用于指定有关JAR文件及其条目的元信息。

也可以看看:

Summary

Inherited constants

From class java.util.zip.ZipOutputStream

Inherited fields

From class java.util.zip.DeflaterOutputStream
From class java.io.FilterOutputStream

Public constructors

JarOutputStream(OutputStream out, Manifest man)

创建一个新 JarOutputStream与指定 Manifest

JarOutputStream(OutputStream out)

创建一个没有清单的新的 JarOutputStream

Public methods

void putNextEntry(ZipEntry ze)

开始编写新的JAR文件条目并将流定位到条目数据的开头。

Inherited methods

From class java.util.zip.ZipOutputStream
From class java.util.zip.DeflaterOutputStream
From class java.io.FilterOutputStream
From class java.io.OutputStream
From class java.lang.Object
From interface java.io.Closeable
From interface java.io.Flushable
From interface java.lang.AutoCloseable

Public constructors

JarOutputStream

Added in API level 1
JarOutputStream (OutputStream out, 
                Manifest man)

创建一个新JarOutputStream与指定Manifest 清单被写为输出流的第一个条目。

Parameters
out OutputStream: the actual output stream
man Manifest: the optional Manifest
Throws
IOException if an I/O error has occurred

JarOutputStream

Added in API level 1
JarOutputStream (OutputStream out)

创建一个没有清单的新的 JarOutputStream

Parameters
out OutputStream: the actual output stream
Throws
IOException if an I/O error has occurred

Public methods

putNextEntry

Added in API level 1
void putNextEntry (ZipEntry ze)

开始编写新的JAR文件条目并将流定位到条目数据的开头。 此方法也将关闭任何以前的条目。 如果没有为条目指定压缩方法,将使用默认压缩方法。 如果条目没有设置修改时间,将使用当前时间。

Parameters
ze ZipEntry: the ZIP/JAR entry to be written
Throws
ZipException if a ZIP error has occurred
IOException if an I/O error has occurred

Hooray!