01: /*
02: * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
03: * (http://h2database.com/html/license.html).
04: * Initial Developer: H2 Group
05: */
06: package org.h2.compress;
07:
08: /**
09: * This class implements a data compression algorithm that does in fact not
10: * compress. This is useful if the data can not be compressed because it is
11: * encrypted, already compressed, or random.
12: */
13: public class CompressNo implements Compressor {
14:
15: public int getAlgorithm() {
16: return Compressor.NO;
17: }
18:
19: public void setOptions(String options) {
20: }
21:
22: public int compress(byte[] in, int inLen, byte[] out, int outPos) {
23: System.arraycopy(in, 0, out, outPos, inLen);
24: return outPos + inLen;
25: }
26:
27: public void expand(byte[] in, int inPos, int inLen, byte[] out,
28: int outPos, int outLen) {
29: System.arraycopy(in, inPos, out, outPos, outLen);
30: }
31:
32: }
|