File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\compress\Compressor.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.compress;
8
9
10 /**
11 * Each data compression algorithm must implement this interface.
12 */
13 public interface Compressor {
14
15 /**
16 * No compression is used.
17 */
18 int NO = 0;
19
20 /**
21 * The LZF compression algorithm is used
22 */
23 int LZF = 1;
24
25 /**
26 * The DEFLATE compression algorithm is used.
27 */
28 int DEFLATE = 2;
29
30 /**
31 * Get the compression algorithm type.
32 *
33 * @return the type
34 */
35 int getAlgorithm();
36
37 /**
38 * Compress a number of bytes.
39 *
40 * @param in the input data
41 * @param inLen the number of bytes to compress
42 * @param out the output area
43 * @param outPos the offset at the output array
44 * @return the end position
45 */
46 int compress(byte[] in, int inLen, byte[] out, int outPos);
47
48 /**
49 * Expand a number of compressed bytes.
50 *
51 * @param in the compressed data
52 * @param inPos the offset at the input array
53 * @param inLen the number of bytes to read
54 * @param out the output area
55 * @param outPos the offset at the output array
56 * @param outLen the size of the uncompressed data
57 */
58 void expand(byte[] in, int inPos, int inLen, byte[] out, int outPos, int outLen);
59
60 /**
61 * Set the compression options. This may include settings for
62 * higher performance but less compression.
63 *
64 * @param options the options
65 */
66 void setOptions(String options);
67 }
68