]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - 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
diff --git a/bundles/org.simantics.fastlz/src/org/simantics/fastlz/FastLZCodec.java b/bundles/org.simantics.fastlz/src/org/simantics/fastlz/FastLZCodec.java
new file mode 100644 (file)
index 0000000..52c5528
--- /dev/null
@@ -0,0 +1,61 @@
+package org.simantics.fastlz;\r
+\r
+import java.io.File;\r
+import java.io.FileNotFoundException;\r
+import java.io.InputStream;\r
+import java.io.OutputStream;\r
+import java.nio.ByteBuffer;\r
+\r
+import org.simantics.compressions.CompressionCodec;\r
+import org.simantics.compressions.Compressions;\r
+\r
+public class FastLZCodec implements CompressionCodec {\r
+\r
+    public FastLZCodec() {\r
+    }\r
+    \r
+    @Override\r
+    public int compressBound(int inputSize) {\r
+        return FastLZ.compressBound(inputSize);\r
+    }\r
+\r
+    @Override\r
+    public int compressBuffer(ByteBuffer input, int inputOffset,\r
+            int length, ByteBuffer output, int outputOffset) {\r
+        return FastLZ.compressBuffer(input, inputOffset, length, output, outputOffset);\r
+    }\r
+\r
+    @Override\r
+    public int decompressBuffer(ByteBuffer input, int inputOffset,\r
+            int length, ByteBuffer output, int outputOffset, int maxout) {\r
+        return FastLZ.decompressBuffer(input, inputOffset, length, output, outputOffset, maxout);\r
+    }\r
+\r
+    @Override\r
+    public InputStream read(File file) throws FileNotFoundException {\r
+        return FastLZ.read(file);\r
+    }\r
+\r
+    @Override\r
+    public OutputStream write(File file) throws FileNotFoundException {\r
+        return FastLZ.write(file);\r
+    }\r
+\r
+    @Override\r
+    public int compress(byte[] uncompressedData, int i, int length,\r
+            byte[] compressedData, int j) {\r
+        throw new UnsupportedOperationException("Not implemented!");\r
+    }\r
+\r
+    @Override\r
+    public byte[] decompress(byte[] compressedData, int i,\r
+            int uncompressedLength) {\r
+        throw new UnsupportedOperationException("Not implemented!");\r
+    }\r
+\r
+    @Override\r
+    public String getId() {\r
+        return Compressions.FASTLZ;\r
+    }\r
+\r
+}\r