java.util.zip.GZIPInputStream翻译

 
JavaTM 2 Platform
Std. Ed. v1.4.2

java.util.zip
Class GZIPInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended byjava.util.zip.InflaterInputStream
              extended byjava.util.zip.GZIPInputStream

public class GZIPInputStream extends InflaterInputStream

This class implements a stream filter for reading compressed data in the GZIP format. 实现读取以GZIP格式压缩数据的流过滤器的类。

See Also:
InflaterInputStream

Field Summary
protected  CRC32crc
          CRC-32 for uncompressed data. 用于解压数据的CRC-32。
protected  booleaneos
          Indicates end of input stream. 表示输入流尾。
static intGZIP_MAGIC
          GZIP header magic number. GZIP头magic数。
 
Fields inherited from class java.util.zip.InflaterInputStream
buf, inf, len
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
GZIPInputStream(InputStream in)
          Creates a new input stream with a default buffer size. 使用默认缓冲大小创建输入流。
GZIPInputStream(InputStream in, int size)
          Creates a new input stream with the specified buffer size. 使用指定缓冲大小创建输入流。
 
Method Summary
 voidclose()
          Closes the input stream. 关闭输入流。
 intread(byte[] buf, int off, int len)
          Reads uncompressed data into an array of bytes. 将解压数据读入到字节数组。
 
Methods inherited from class java.util.zip.InflaterInputStream
available, fill, read, skip
 
Methods inherited from class java.io.FilterInputStream
mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crc

protected CRC32 crc
CRC-32 for uncompressed data. 用于解压数据的CRC-32。


eos

protected boolean eos
Indicates end of input stream. 表示输入流尾。


GZIP_MAGIC

public static final int GZIP_MAGIC
GZIP header magic number. GZIP头magic数。

See Also:
Constant Field Values
Constructor Detail

GZIPInputStream

public GZIPInputStream(InputStream in,
                       int size)
                throws IOException
Creates a new input stream with the specified buffer size. 使用指定缓冲大小创建输入流。

Parameters:
in - the input stream 输入流
size - the input buffer size 输入缓冲大小
Throws:
IOException - if an I/O error has occurred 如果发生I/O错误抛出
IllegalArgumentException - if size is <= 0 如果大小<= 0抛出

GZIPInputStream

public GZIPInputStream(InputStream in)
                throws IOException
Creates a new input stream with a default buffer size. 使用默认缓冲大小创建输入流。

Parameters:
in - the input stream 输入流
Throws:
IOException - if an I/O error has occurred 如果发生I/O错误抛出
Method Detail

read

public int read(byte[] buf,
                int off,
                int len)
         throws IOException
Reads uncompressed data into an array of bytes. Blocks until enough input is available for decompression. 将解压数据读入到字节数组。阻塞直到足够的输入用于解压。

Overrides:
read in class InflaterInputStream
Parameters:
buf - the buffer into which the data is read 数据读入的缓冲
off - the start offset of the data 数据的起始缓冲
len - the maximum number of bytes read 读入的最大字节数
Returns:
the actual number of bytes read, or -1 if the end of the compressed input stream is reached 读入的实际字节数,如果到达已压缩的输入流末端,返回-1
Throws:
IOException - if an I/O error has occurred or the compressed input data is corrupt 如果发生I/O错误或者压缩的输入数据被破坏抛出

close

public void close()
           throws IOException
Closes the input stream. 关闭输入流。

Overrides:
close in class InflaterInputStream
Throws:
IOException - if an I/O error has occurred 如果发生I/O错误抛出

JavaTM 2 Platform
Std. Ed. v1.4.2

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation . That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值