public class Deflater extends Object
This class works exactly the same as java.util.zip.Deflater, however the java.util.zip package is an optional package for the Eve VM. However this version of Deflater and DeflaterOutputStream will always exist in any Eve VM.
This class is not thread safe. This is inherent in the API, due to the split of deflate and setInput.
Modifier and Type | Field and Description |
---|---|
static int |
BEST_COMPRESSION
The best and slowest compression level.
|
static int |
BEST_SPEED
The worst but fastest compression level.
|
static int |
DEFAULT_COMPRESSION
The default compression level.
|
static int |
DEFAULT_STRATEGY
The default strategy.
|
static int |
DEFLATED
The compression method.
|
static int |
FILTERED
This strategy will only allow longer string repetitions.
|
static int |
HUFFMAN_ONLY
This strategy will not look for string repetitions at all.
|
static int |
NO_COMPRESSION
This level won't compress at all but output uncompressed blocks.
|
Constructor and Description |
---|
Deflater()
Creates a new inflater.
|
Deflater(int level) |
Deflater(int level,
boolean noWrap) |
Modifier and Type | Method and Description |
---|---|
ICompressed |
compress(byte[] src,
int offset,
int length)
Compress all the data as one block.
|
ICompressed |
compress(int[] src,
int offset,
int length)
Compress all the data as one block.
|
int |
deflate(byte[] b) |
int |
deflate(byte[] b,
int off,
int len) |
void |
end() |
protected void |
finalize()
This method (when overriden), will be called when the VM determines that the Object can be
garbage collected.
|
void |
finish() |
boolean |
finished() |
int |
getAdler() |
long |
getBytesRead() |
long |
getBytesWritten() |
int |
getTotalIn() |
int |
getTotalOut() |
boolean |
needsInput() |
void |
reset() |
void |
setDictionary(byte[] b) |
void |
setDictionary(byte[] b,
int off,
int len) |
void |
setInput(byte[] b) |
void |
setInput(byte[] b,
int off,
int len) |
void |
setLevel(int level) |
void |
setStrategy(int strategy) |
public static final int BEST_COMPRESSION
public static final int BEST_SPEED
public static final int DEFAULT_COMPRESSION
public static final int NO_COMPRESSION
public static final int DEFAULT_STRATEGY
public static final int FILTERED
public static final int HUFFMAN_ONLY
public static final int DEFLATED
public Deflater()
public Deflater(int level)
public Deflater(int level, boolean noWrap)
public void setLevel(int level)
public void setStrategy(int strategy)
public ICompressed compress(byte[] src, int offset, int length)
src
- offset
- length
- public ICompressed compress(int[] src, int offset, int length)
src
- offset
- length
- public void reset()
public int deflate(byte[] b, int off, int len)
public void setInput(byte[] b, int off, int len)
public void setDictionary(byte[] b, int off, int len)
public void end()
public void finish()
protected void finalize()
Object
The finalize() method of a Class is only called if it overrides finalize() - the finalize() method java.lang.Object is never called by the Eve VM.
public void setInput(byte[] b)
public void setDictionary(byte[] b)
public int deflate(byte[] b)
public boolean finished()
public boolean needsInput()
public long getBytesRead()
public long getBytesWritten()
public int getTotalIn()
public int getTotalOut()
public int getAdler()