Package org.h2.compress
Class CompressNo
- java.lang.Object
-
- org.h2.compress.CompressNo
-
- All Implemented Interfaces:
Compressor
public class CompressNo extends java.lang.Object implements Compressor
This class implements a data compression algorithm that does in fact not compress. This is useful if the data can not be compressed because it is encrypted, already compressed, or random.
-
-
Field Summary
-
Fields inherited from interface org.h2.compress.Compressor
DEFLATE, LZF, NO
-
-
Constructor Summary
Constructors Constructor Description CompressNo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
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
getAlgorithm()
Get the compression algorithm type.void
setOptions(java.lang.String options)
Set the compression options.
-
-
-
Method Detail
-
getAlgorithm
public int getAlgorithm()
Description copied from interface:Compressor
Get the compression algorithm type.- Specified by:
getAlgorithm
in interfaceCompressor
- Returns:
- the type
-
setOptions
public void setOptions(java.lang.String options)
Description copied from interface:Compressor
Set the compression options. This may include settings for higher performance but less compression.- Specified by:
setOptions
in interfaceCompressor
- Parameters:
options
- the options
-
compress
public int compress(byte[] in, int inPos, int inLen, byte[] out, int outPos)
Description copied from interface:Compressor
Compress a number of bytes.- Specified by:
compress
in 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
-
expand
public void expand(byte[] in, int inPos, int inLen, byte[] out, int outPos, int outLen)
Description copied from interface:Compressor
Expand a number of compressed bytes.- Specified by:
expand
in 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
-
-