org.h2.compress
Class CompressDeflate

java.lang.Object
  extended by 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:

See also java.util.zip.Deflater for details.


Field Summary
 
Fields inherited from interface org.h2.compress.Compressor
DEFLATE, LZF, NO
 
Constructor Summary
CompressDeflate()
           
 
Method Summary
 int compress(byte[] in, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompressDeflate

public CompressDeflate()
Method Detail

setOptions

public void setOptions(java.lang.String options)
                throws java.sql.SQLException
Description copied from interface: Compressor
Set the compression options. This may include settings for higher performance but less compression.

Specified by:
setOptions in interface Compressor
Parameters:
options - the options
Throws:
java.sql.SQLException

compress

public int compress(byte[] in,
                    int inLen,
                    byte[] out,
                    int outPos)
Description copied from interface: Compressor
Compress a number of bytes.

Specified by:
compress in interface Compressor
Parameters:
in - the input data
inLen - the number of bytes to compress
out - the output area
outPos - the offset at the output array
Returns:
the size of the compressed data

getAlgorithm

public int getAlgorithm()
Description copied from interface: Compressor
Get the compression algorithm type.

Specified by:
getAlgorithm in interface Compressor
Returns:
the type

expand

public void expand(byte[] in,
                   int inPos,
                   int inLen,
                   byte[] out,
                   int outPos,
                   int outLen)
            throws java.sql.SQLException
Description copied from interface: Compressor
Expand a number of compressed bytes.

Specified by:
expand in interface Compressor
Parameters:
in - the compressed data
inPos - the offset at the input array
inLen - the number of bytes to read
out - the output area
outPos - the offset at the output array
outLen - the size of the uncompressed data
Throws:
java.sql.SQLException