--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.lz4.impl;\r
+\r
+import java.io.File;\r
+import java.io.FileInputStream;\r
+import java.io.FileNotFoundException;\r
+import java.io.InputStream;\r
+import java.nio.ByteBuffer;\r
+import java.nio.channels.ReadableByteChannel;\r
+\r
+import org.simantics.compressions.impl.DecompressingInputStream;\r
+import org.simantics.lz4.LZ4;\r
+\r
+\r
+/**\r
+ * @author Tuukka Lehtonen\r
+ */\r
+public class LZ4InputStream extends DecompressingInputStream {\r
+\r
+ public LZ4InputStream(File file) throws FileNotFoundException {\r
+ super(file);\r
+ }\r
+\r
+ public LZ4InputStream(FileInputStream stream) {\r
+ super(stream);\r
+ }\r
+ \r
+ public LZ4InputStream(InputStream stream) {\r
+ super(stream);\r
+ }\r
+\r
+ public LZ4InputStream(InputStream stream, ReadableByteChannel channel) {\r
+ super(stream, channel);\r
+ }\r
+\r
+ @Override\r
+ public void decompress(ByteBuffer compressed, int compressedOffset, int compressedSize, ByteBuffer uncompressed,\r
+ int uncompressedOffset, int uncompressedSize) {\r
+ LZ4.decompressBuffer(compressed, compressedOffset, compressedSize, uncompressed, uncompressedOffset, uncompressedSize);\r
+ }\r
+\r
+}\r