public final class GZip
extends java.lang.Object
The ZLib library home page isgzip (GNU zip) is a compression utility designed to be a replacement for compress. Its main advantages over compress are much better compression and freedom from patented algorithms. It has been adopted by the GNU project and is now relatively popular on the Internet.
Modifier and Type | Method and Description |
---|---|
static int |
deflate(Stream in,
Stream out)
Deflates the given stream 'in', writing the compressed data to the given stream 'out'.
|
static int |
inflate(Stream in,
Stream out)
Attempts to fully read the given stream 'in', inflate its content and write the uncompressed data to the given
stream 'out'.
|
static int |
inflate(Stream in,
Stream out,
int sizeIn)
Attempts to read the number of bytes specified by 'sizeIn' from the the given stream 'in', inflating and writing
to the given stream 'out'.
|
public static int deflate(Stream in, Stream out) throws IOException
in
- Stream to be deflated.out
- Deflated stream.IOException
public static int inflate(Stream in, Stream out) throws IOException, ZipException
in
- Deflated input streamout
- Inflated output streamZipException
IOException
public static int inflate(Stream in, Stream out, int sizeIn) throws IOException, ZipException
in
- Deflated input streamout
- Inflated output streamsizeIn
- How many bytes to read, or -1 to read until in
's end.IOException
ZipException