当前位置 类层次(JDK) 所有类 (JDK) 所有域和方法 (JDK)

类 java.util.zip.Inflater

java.lang.Object
   |
   +----java.util.zip.Inflater

public class Inflater
extends Object

该类使用著名的 ZLIB 压缩程序库为通常的解压缩提供支持。 ZLIB 压缩程序库最初是作为 PNG 图形标准的部件开发出来的,并且不受专利的保护。详细描述见 1950、1951 和 1952 的 RFCs 。

参见:
Deflater

构造子索引

Inflater()
创建一个新的解压缩器。
Inflater(boolean)
创建一个新的解压缩器。

方法索引

end()
废除未处理的输入并释放内部的数据。
finalize()
当收集无用信息时释放解压缩器。
finished()
如果已到达压缩数据流的结尾返回 true 。
getAdler()
返回未压缩数据的 ADLER-32 值。
getRemaining()
返回输入缓冲区中剩余的字节总数。
getTotalIn()
返回到目前为止输入的字节总数。
getTotalOut()
返回到目前为止输出的字节总数。
inflate(byte[])
解压缩字节到指定的缓冲区。
inflate(byte[], int, int)
解压缩字节到指定的缓冲区。
needsDictionary()
如果解压缩需要预制的词典返回 true 。
needsInput()
如果输入缓冲区中没有剩余数据返回 true 。
reset()
复位 inflater 以使新的输入数据集可以被处理。
setDictionary(byte[])
设置预制词典为给定的字节数组。
setDictionary(byte[], int, int)
设置预制词典为给定的字节数组。
setInput(byte[])
为解压缩设置输入数据。
setInput(byte[], int, int)
为解压缩输入数据。

构造子

Inflater
 public Inflater(boolean nowrap)
创建一个新的解压缩器。 如果参数 'nowrap' 为 true ,则不使用 ZLIB 首部和校验和域以支持 GZIP 和 PKZIP 使用的压缩格式。

参数:
nowrap - 如果为 true ,则支持 GZIP 兼容的压缩。
Inflater
 public Inflater()
创建一个新的解压缩器。


方法

setInput
 public synchronized void setInput(byte b[],
                   int off,
                   int len)
为解压缩输入数据。该方法应在 needsInput() 返回 true,以指示需要更多的输入数据。

参数:
b - 输入数据字节
off - 输入数据的起始偏移量。
len - 输入数据的长度
参见:
needsInput
setInput
 public void setInput(byte b[])
为解压缩设置输入数据。该方法应在 needsInput() 返回 true,以指示需要更多的输入数据。

参数:
b - 输入数据字节
参见:
needsInput
setDictionary
 public native synchronized void setDictionary(byte b[],
                   int off,
                   int len)
设置预制词典为给定的字节数组。 该方法应在 inflate() 返回 0 且 needsDictionary() 返回 true ,以指示需要预置词典。方法 getAdler() 可用于获取所需词典的 Adler-32 值。

参数:
b - 词典数据字节
off - 数据的初始偏移量
len - 数据的长度
参见:
needsDictionary, getAdler
setDictionary
 public void setDictionary(byte b[])
设置预制词典为给定的字节数组。 该方法应在 inflate() 返回 0 且 needsDictionary() 返回 true ,以指示需要预置词典。方法 getAdler() 可用于获取所需词典的 Adler-32 值。

参数:
b - 词典数据字节
参见:
needsDictionary, getAdler
getRemaining
 public synchronized int getRemaining()
返回输入缓冲区中剩余的字节总数。 该方法可用于查找在解压缩之后还有什么字节留在输入缓冲区里。

needsInput
 public synchronized boolean needsInput()
如果输入缓冲区中没有剩余数据返回 true 。该方法决定为了提供更多的输入是否调用 #setInputThis 。

needsDictionary
 public synchronized boolean needsDictionary()
如果解压缩需要预制词典时返回 true 。

参见:
InflatesetDictionary
finished
 public synchronized boolean finished()
如果已到达压缩数据流的结尾时返回 true 。

inflate
 public native synchronized int inflate(byte b[],
                   int off,
                                        int len) throws DataFormatException
解压缩字节到指定的缓冲区。返回实际的解压缩字节数。返回值 0 指示应调用 needsInput() 或 needsDictionary() 以决定是否需要更多的数据或预制词典。在后一种情况下,getAdler() 可用于获得所需词典的 Adler-32 值。

参数:
b - 解压缩数据的缓冲区
off - 数据的初始偏移量
len - 最大的解压缩字节数
返回值:
实际的解压缩字节数
抛出: DataFormatException
如果压缩数据格式无效
参见:
needsInput, needsDictionary
inflate
 public int inflate(byte b[]) throws DataFormatException
解压缩字节到指定的缓冲区。返回实际的解压缩字节数。返回值 0 指示应调用 needsInput() 或 needsDictionary() 以决定是否需要更多的数据或预制词典。在后一种情况下,getAdler() 可用于获得所需词典的 Adler-32 值。

参数:
b - 解压缩数据的缓冲区
返回值:
实际的解压缩字节数
抛出: DataFormatException
如果压缩数据格式无效
参见:
needsInput, needsDictionary
getAdler
 public native synchronized int getAdler()
返回未压缩数据的 ADLER-32 值。

getTotalIn
 public native synchronized int getTotalIn()
返回到目前为止输入的字节总数。

getTotalOut
 public native synchronized int getTotalOut()
返回到目前为止输出的字节总数。

reset
 public native synchronized void reset()
复位 inflater 以使可以处理新的输入数据集合。

end
 public native synchronized void end()
废除未处理的输入并释放内部的数据。

finalize
 protected void finalize()
当收集无用信息时释放解压缩器。

覆盖:
Object 中的 finalize

当前位置 类层次(JDK) 所有类 (JDK) 所有域和方法 (JDK)