Top Description Fields Methods
org.h2.compress

public Interface Compressor

Known Direct Implementers
org.h2.compress.CompressDeflate, org.h2.compress.CompressLZF, org.h2.compress.CompressNo

Each data compression algorithm must implement this interface.

Field Summary

Modifier and TypeField and Description
public static final int
DEFLATE

The DEFLATE compression algorithm is used.

public static final int
LZF

The LZF compression algorithm is used

public static final int
NO

No compression is used.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the end position
compress
(byte[]
the input data
in
,
int
the offset at the input array
inPos
,
int
the number of bytes to compress
inLen
,
byte[]
the output area
out
,
int
the offset at the output array
outPos
)

Compress a number of bytes.

public void
expand(byte[]
the compressed data
in
,
int
the offset at the input array
inPos
,
int
the number of bytes to read
inLen
,
byte[]
the output area
out
,
int
the offset at the output array
outPos
,
int
the size of the uncompressed data
outLen
)

Expand a number of compressed bytes.

public int

Returns:

the type
getAlgorithm
()

Get the compression algorithm type.

public void
setOptions(String
the options
options
)

Set the compression options.

Field Detail

DEFLATEback to summary
public static final int DEFLATE

The DEFLATE compression algorithm is used.

LZFback to summary
public static final int LZF

The LZF compression algorithm is used

NOback to summary
public static final int NO

No compression is used.

Method Detail

compressback to summary
public int compress(byte[] in, int inPos, int inLen, byte[] out, int outPos)

Compress a number of bytes.

Parameters
in:byte[]

the input data

inPos:int

the offset at the input array

inLen:int

the number of bytes to compress

out:byte[]

the output area

outPos:int

the offset at the output array

Returns:int

the end position

expandback to summary
public void expand(byte[] in, int inPos, int inLen, byte[] out, int outPos, int outLen)

Expand a number of compressed bytes.

Parameters
in:byte[]

the compressed data

inPos:int

the offset at the input array

inLen:int

the number of bytes to read

out:byte[]

the output area

outPos:int

the offset at the output array

outLen:int

the size of the uncompressed data

getAlgorithmback to summary
public int getAlgorithm()

Get the compression algorithm type.

Returns:int

the type

setOptionsback to summary
public void setOptions(String options)

Set the compression options. This may include settings for higher performance but less compression.

Parameters
options:String

the options