1 package org.simantics.fastlz;
4 import java.io.FileNotFoundException;
5 import java.io.InputStream;
6 import java.io.OutputStream;
7 import java.nio.ByteBuffer;
9 import org.simantics.compressions.CompressionCodec;
10 import org.simantics.compressions.Compressions;
12 public class FastLZCodec implements CompressionCodec {
14 public FastLZCodec() {
18 public int compressBound(int inputSize) {
19 return FastLZ.compressBound(inputSize);
23 public int compressBuffer(ByteBuffer input, int inputOffset,
24 int length, ByteBuffer output, int outputOffset) {
25 return FastLZ.compressBuffer(input, inputOffset, length, output, outputOffset);
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);
35 public InputStream read(File file) throws FileNotFoundException {
36 return FastLZ.read(file);
40 public OutputStream write(File file) throws FileNotFoundException {
41 return FastLZ.write(file);
45 public int compress(byte[] uncompressedData, int i, int length,
46 byte[] compressedData, int j) {
47 throw new UnsupportedOperationException("Not implemented!");
51 public byte[] decompress(byte[] compressedData, int i,
52 int uncompressedLength) {
53 throw new UnsupportedOperationException("Not implemented!");
57 public String getId() {
58 return Compressions.FASTLZ;