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