Package org.h2.compress
Interface Compressor
- All Known Implementing Classes:
CompressDeflate
,CompressLZF
,CompressNo
public interface Compressor
Each data compression algorithm must implement this interface.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionint
compress
(byte[] in, int inPos, int inLen, byte[] out, int outPos) Compress a number of bytes.void
expand
(byte[] in, int inPos, int inLen, byte[] out, int outPos, int outLen) Expand a number of compressed bytes.int
Get the compression algorithm type.void
setOptions
(String options) Set the compression options.
-
Field Details
-
NO
static final int NONo compression is used.- See Also:
-
LZF
static final int LZFThe LZF compression algorithm is used- See Also:
-
DEFLATE
static final int DEFLATEThe DEFLATE compression algorithm is used.- See Also:
-
-
Method Details
-
getAlgorithm
int getAlgorithm()Get the compression algorithm type.- Returns:
- the type
-
compress
int compress(byte[] in, int inPos, int inLen, byte[] out, int outPos) Compress a number of bytes.- 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
-
expand
void expand(byte[] in, int inPos, int inLen, byte[] out, int outPos, int outLen) Expand a number of compressed bytes.- 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
-
setOptions
Set the compression options. This may include settings for higher performance but less compression.- Parameters:
options
- the options
-