|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jimi.util.zip.Inflater
A class to uncompress data stored in the DEFLATE , as described in RFC 1951.
DEFLATE is the compression method used in the popular gzip and (pk)zip utilities. This class will not read zip or gzip files directly, but it provides most of the necessary functions.
This class is a direct translation of the inflate portion of the freely available zlib general purpose compression library, bearing the copyright:
Copyright (C) 1995-1996 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler gzip@prep.ai.mit.edu madler@alumni.caltech.eduPlease do not contact either of the above authors regarding the java version of this library.
Field Summary | |
byte[] |
array_in
the array which contains the compressed data |
byte[] |
array_out
the array which will recieve the uncompressed data |
int |
avail_in
the number of bytes available in array_in |
int |
avail_out
the number of free bytes in array_out |
static byte[] |
copyright
|
static java.lang.String |
Copyright
|
java.lang.String |
msg
|
int |
next_in
the index of the first byte of compressed data in array_in |
int |
next_out
the index of the first available byte in array_out |
int |
total_in
the total number of bytes that have been read so far |
int |
total_out
the total number of bytes that have been output so far |
static int |
Z_BUF_ERROR
Indicates that no progress was made, or there was not enough room in the output buffer when Z_FINISH is used |
static int |
Z_DATA_ERROR
Indicates that the input data was corrupted |
static int |
Z_ERRNO
|
static int |
Z_FINISH
Informs inflate() that this is the last of the data. |
static int |
Z_FULL_FLUSH
|
static int |
Z_NEED_DICT
Indicates that a preset dictionary is needed before decompression continues |
static int |
Z_NO_FLUSH
|
static int |
Z_OK
Indicates that no errors were encountered |
static int |
Z_PARTIAL_FLUSH
Specifies that the Inflater should flush as much of the output as possible to the output buffer |
static int |
Z_STREAM_END
Indicates that the end of the stream has been reached, and all uncompressed data has been flushed |
static int |
Z_STREAM_ERROR
Indicates that the stream was inconsistent (for example, if array_in or array_out were null) |
static int |
Z_SYNC_FLUSH
|
Constructor Summary | |
Inflater()
Constructs a new Inflater object. |
|
Inflater(boolean nowrap)
Constructs an inflater object. |
Method Summary | |
void |
enableAdler(boolean check)
Enables or disables the computation of the Adler32 CRC. |
boolean |
finished()
Returns true if the end of the data stream has been reached |
int |
getAdler()
Returns the current Adler32 Checksum of the stream |
int |
getRemaining()
Tells how many bytes are remaining in the input array |
int |
getTotalIn()
Returns the number of bytes processed by the Inflater object so far |
int |
getTotalOut()
Returns the number of uncompressed data generated by the Inflater object so far |
long |
inflate_blocks_reset(long c)
|
int |
inflate_blocks(int r)
|
int |
inflate_codes(int r)
|
int |
inflate_fast(int bl,
int bd,
com.sun.jimi.util.zip.huft tl,
com.sun.jimi.util.zip.huft td)
|
protected int |
inflate_flush(int r)
|
int |
inflate_unlocked(int f)
|
int |
inflate(byte[] buf,
int off,
int len)
Inflates the compressed data to the specified output location. |
static void |
main(java.lang.String[] args)
|
boolean |
needsDictionary()
Tells whether or not a preset dictionary is needed (only for ZLIB streams) Currently not implemented. |
boolean |
needsInput()
Tells whether or not more input is needed |
void |
reset()
Reset the internal state of the object so that it can be used for another decompression run |
void |
setInput(byte[] buf,
int off,
int len)
Tells the Inflater where to take input from |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public byte[] array_in
public int next_in
public int avail_in
public int total_in
public byte[] array_out
public int next_out
public int avail_out
public int total_out
public static final int Z_NO_FLUSH
public static final int Z_PARTIAL_FLUSH
public static final int Z_SYNC_FLUSH
public static final int Z_FULL_FLUSH
public static final int Z_FINISH
public static final int Z_OK
public static final int Z_STREAM_END
public static final int Z_NEED_DICT
public static final int Z_ERRNO
public static final int Z_STREAM_ERROR
public static final int Z_DATA_ERROR
public static final int Z_BUF_ERROR
public static final java.lang.String Copyright
public static final byte[] copyright
public java.lang.String msg
Constructor Detail |
public Inflater(boolean nowrap)
nowrap
- Does not wrap the DEFLATE stream with the ZLIB informationpublic Inflater()
Method Detail |
public void reset()
public void setInput(byte[] buf, int off, int len)
buf
- the array containing the compressed dataoff
- the index of the first byte in the arraylen
- the number of bytes of data in the arraypublic int getRemaining()
public boolean needsInput()
public boolean needsDictionary()
public final long inflate_blocks_reset(long c)
public int inflate(byte[] buf, int off, int len) throws DataFormatException
buf
- the array in which to store the dataoff
- the index of the first available output locationlen
- how many bytes are available therepublic int getAdler()
public int getTotalIn()
public int getTotalOut()
public boolean finished()
public void enableAdler(boolean check)
check
- if true, enables Adler32 checkingpublic final int inflate_unlocked(int f)
protected int inflate_flush(int r)
public final int inflate_codes(int r)
public final int inflate_fast(int bl, int bd, com.sun.jimi.util.zip.huft tl, com.sun.jimi.util.zip.huft td)
public final int inflate_blocks(int r)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |