]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.fastlz/src/org/simantics/fastlz/FastLZCodec.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.fastlz / src / org / simantics / fastlz / FastLZCodec.java
1 package org.simantics.fastlz;\r
2 \r
3 import java.io.File;\r
4 import java.io.FileNotFoundException;\r
5 import java.io.InputStream;\r
6 import java.io.OutputStream;\r
7 import java.nio.ByteBuffer;\r
8 \r
9 import org.simantics.compressions.CompressionCodec;\r
10 import org.simantics.compressions.Compressions;\r
11 \r
12 public class FastLZCodec implements CompressionCodec {\r
13 \r
14     public FastLZCodec() {\r
15     }\r
16     \r
17     @Override\r
18     public int compressBound(int inputSize) {\r
19         return FastLZ.compressBound(inputSize);\r
20     }\r
21 \r
22     @Override\r
23     public int compressBuffer(ByteBuffer input, int inputOffset,\r
24             int length, ByteBuffer output, int outputOffset) {\r
25         return FastLZ.compressBuffer(input, inputOffset, length, output, outputOffset);\r
26     }\r
27 \r
28     @Override\r
29     public int decompressBuffer(ByteBuffer input, int inputOffset,\r
30             int length, ByteBuffer output, int outputOffset, int maxout) {\r
31         return FastLZ.decompressBuffer(input, inputOffset, length, output, outputOffset, maxout);\r
32     }\r
33 \r
34     @Override\r
35     public InputStream read(File file) throws FileNotFoundException {\r
36         return FastLZ.read(file);\r
37     }\r
38 \r
39     @Override\r
40     public OutputStream write(File file) throws FileNotFoundException {\r
41         return FastLZ.write(file);\r
42     }\r
43 \r
44     @Override\r
45     public int compress(byte[] uncompressedData, int i, int length,\r
46             byte[] compressedData, int j) {\r
47         throw new UnsupportedOperationException("Not implemented!");\r
48     }\r
49 \r
50     @Override\r
51     public byte[] decompress(byte[] compressedData, int i,\r
52             int uncompressedLength) {\r
53         throw new UnsupportedOperationException("Not implemented!");\r
54     }\r
55 \r
56     @Override\r
57     public String getId() {\r
58         return Compressions.FASTLZ;\r
59     }\r
60 \r
61 }\r