Package org.h2.compress
Class CompressDeflate
- java.lang.Object
-
- org.h2.compress.CompressDeflate
-
- All Implemented Interfaces:
Compressor
public class CompressDeflate extends java.lang.Object implements Compressor
This is a wrapper class for the Deflater class. This algorithm supports the following options:- l or level: -1 (default), 0 (no compression), 1 (best speed), ..., 9 (best compression)
- s or strategy: 0 (default), 1 (filtered), 2 (huffman only)
-
-
Constructor Summary
Constructors Constructor Description CompressDeflate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompress(byte[] in, int inPos, int inLen, byte[] out, int outPos)Compress a number of bytes.voidexpand(byte[] in, int inPos, int inLen, byte[] out, int outPos, int outLen)Expand a number of compressed bytes.intgetAlgorithm()Get the compression algorithm type.voidsetOptions(java.lang.String options)Set the compression options.
-
-
-
Method Detail
-
setOptions
public void setOptions(java.lang.String options)
Description copied from interface:CompressorSet the compression options. This may include settings for higher performance but less compression.- Specified by:
setOptionsin interfaceCompressor- Parameters:
options- the options
-
compress
public int compress(byte[] in, int inPos, int inLen, byte[] out, int outPos)Description copied from interface:CompressorCompress a number of bytes.- Specified by:
compressin interfaceCompressor- Parameters:
in- the input datainPos- the offset at the input arrayinLen- the number of bytes to compressout- the output areaoutPos- the offset at the output array- Returns:
- the end position
-
getAlgorithm
public int getAlgorithm()
Description copied from interface:CompressorGet the compression algorithm type.- Specified by:
getAlgorithmin interfaceCompressor- Returns:
- the type
-
expand
public void expand(byte[] in, int inPos, int inLen, byte[] out, int outPos, int outLen)Description copied from interface:CompressorExpand a number of compressed bytes.- Specified by:
expandin interfaceCompressor- Parameters:
in- the compressed datainPos- the offset at the input arrayinLen- the number of bytes to readout- the output areaoutPos- the offset at the output arrayoutLen- the size of the uncompressed data
-
-