File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\compress\CompressNo.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 * This class implements a data compression algorithm that does in fact not
11 * compress. This is useful if the data can not be compressed because it is
12 * encrypted, already compressed, or random.
13 */
14 public class CompressNo implements Compressor {
15
16 public int getAlgorithm() {
17 return Compressor.NO;
18 }
19
20 public void setOptions(String options) {
21 // nothing to do
22 }
23
24 public int compress(byte[] in, int inLen, byte[] out, int outPos) {
25 System.arraycopy(in, 0, out, outPos, inLen);
26 return outPos + inLen;
27 }
28
29 public void expand(byte[] in, int inPos, int inLen, byte[] out, int outPos, int outLen) {
30 System.arraycopy(in, inPos, out, outPos, outLen);
31 }
32
33 }
34