java manifest utf8,java.util.jar 类 Manifest - Java 中文参考手册

java.lang.Object

c8e9f4e075d37a0af332e4af80182959.gifjava.util.jar.Manifest

所有已实现的接口:Cloneable

public class Manifestextends Objectimplements Cloneable

Manifest 类用于维护 Manifest 条目名称及其相关的 Attributes。既有主 Manifest 的 Attributes,也有每个条目的 Attributes。有关 Manifest 格式的信息,请参阅 Manifest 格式规范。

从以下版本开始:

1.2

另请参见:Attributes

构造方法摘要

Manifest()

构造新的空 Manifest。

Manifest(InputStreamis)

从指定的输入流构造新的 Manifest。

Manifest(Manifestman)

构造新的 Manifest,它是指定 Manifest 的副本。

方法摘要

void

clear()

清除此 Manifest 中的主 Attributes 和条目。

Object

clone()

返回 Manifest 的浅表复制。

boolean

equals(Objecto)

如果指定的 Object 也是一个 Manifest,并且具有相同的主 Attributes 和条目,则返回 true。

Attributes

getAttributes(Stringname)

返回指定条目名称的 Attributes。

Map

getEntries()

返回此 Manifest 中所包含条目的 Map。

Attributes

getMainAttributes()

返回 Manifest 的主 Attributes。

int

hashCode()

返回 Manifest 的哈希码。

void

read(InputStreamis)

从指定的 InputStream 读取 Manifest。

void

write(OutputStreamout)

将 Manifest 写入指定的 OutputStream。

从类 java.lang.Object 继承的方法

finalize, getClass, notify, notifyAll, toString, wait, wait, wait

构造方法详细信息

Manifest

public Manifest()

构造新的空 Manifest。

Manifest

public Manifest(InputStreamis)

throws IOException

从指定的输入流构造新的 Manifest。

参数:is – 包含清单数据的输入流抛出:IOException – 如果发生 I/O 错误

Manifest

public Manifest(Manifestman)

构造新的 Manifest,它是指定 Manifest 的副本。

参数:man – 要复制的 Manifest

方法详细信息

getMainAttributes

public Attributes getMainAttributes()

返回 Manifest 的主 Attributes。

返回:Manifest 的主 Attributes

getEntries

public Map getEntries()

返回此 Manifest 中所包含条目的 Map。每个条目由一个 String 名称(键)和相关的 Attributes(值)表示。

返回:此 Manifest 中所包含条目的 Map

getAttributes

public Attributes getAttributes(Stringname)

返回指定条目名称的 Attributes。此方法定义为:

return (Attributes)getEntries().get(name)

参数:name – 条目名称。返回:指定条目名称的 Attributes

clear

public void clear()

清除此 Manifest 中的主 Attributes 和条目。

write

public void write(OutputStreamout)

throws IOException

将 Manifest 写入指定的 OutputStream。在调用此方法前,必须在 MainAttributes 中设置 Attributes.Name.MANIFEST_VERSION。

参数:out – 输出流。抛出:IOException – 如果发生 I/O 错误。另请参见:getMainAttributes()

read

public void read(InputStreamis)

throws IOException

从指定的 InputStream 读取 Manifest。读取的条目名称和属性将与当前的清单条目进行合并。

参数:is – 输入流。抛出:IOException – 如果发生 I/O 错误

equals

public boolean equals(Objecto)

如果指定的 Object 也是一个 Manifest,并且具有相同的主 Attributes 和条目,则返回 true。

覆盖:类 Object 中的 equals

参数:o – 要进行比较的对象返回:如果指定的 Object 也是一个 Manifest,并且具有相同的主 Attributes 和条目,则返回 true另请参见:Object.hashCode(),

Hashtable

hashCode

public int hashCode()

返回 Manifest 的哈希码。

覆盖:类 Object 中的 hashCode

返回:此对象的一个哈希码值。另请参见:Object.equals(java.lang.Object),

Hashtable

clone

public Object clone()

返回 Manifest 的浅表复制。浅表复制的实现方式如下:

public Object clone() { return new Manifest(this); }

覆盖:类 Object 中的 clone

返回:Manifest 的浅表复制另请参见:Cloneable

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值