X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.lz4%2Fsrc%2Forg%2Fsimantics%2Flz4%2Fimpl%2FLZ4InputStream.java;h=ca1ca1774910f0f32da3a933330325a3125f7880;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=2e16886944fcae29120b471c02d6589e2da1d723;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.lz4/src/org/simantics/lz4/impl/LZ4InputStream.java b/bundles/org.simantics.lz4/src/org/simantics/lz4/impl/LZ4InputStream.java index 2e1688694..ca1ca1774 100644 --- a/bundles/org.simantics.lz4/src/org/simantics/lz4/impl/LZ4InputStream.java +++ b/bundles/org.simantics.lz4/src/org/simantics/lz4/impl/LZ4InputStream.java @@ -1,52 +1,52 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.lz4.impl; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.nio.channels.ReadableByteChannel; - -import org.simantics.compressions.impl.DecompressingInputStream; -import org.simantics.lz4.LZ4; - - -/** - * @author Tuukka Lehtonen - */ -public class LZ4InputStream extends DecompressingInputStream { - - public LZ4InputStream(File file) throws FileNotFoundException { - super(file); - } - - public LZ4InputStream(FileInputStream stream) { - super(stream); - } - - public LZ4InputStream(InputStream stream) { - super(stream); - } - - public LZ4InputStream(InputStream stream, ReadableByteChannel channel) { - super(stream, channel); - } - - @Override - public void decompress(ByteBuffer compressed, int compressedOffset, int compressedSize, ByteBuffer uncompressed, - int uncompressedOffset, int uncompressedSize) { - LZ4.decompressBuffer(compressed, compressedOffset, compressedSize, uncompressed, uncompressedOffset, uncompressedSize); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2012 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.lz4.impl; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.channels.ReadableByteChannel; + +import org.simantics.compressions.impl.DecompressingInputStream; +import org.simantics.lz4.LZ4; + + +/** + * @author Tuukka Lehtonen + */ +public class LZ4InputStream extends DecompressingInputStream { + + public LZ4InputStream(File file) throws FileNotFoundException { + super(file); + } + + public LZ4InputStream(FileInputStream stream) { + super(stream); + } + + public LZ4InputStream(InputStream stream) { + super(stream); + } + + public LZ4InputStream(InputStream stream, ReadableByteChannel channel) { + super(stream, channel); + } + + @Override + public void decompress(ByteBuffer compressed, int compressedOffset, int compressedSize, ByteBuffer uncompressed, + int uncompressedOffset, int uncompressedSize) { + LZ4.decompressBuffer(compressed, compressedOffset, compressedSize, uncompressed, uncompressedOffset, uncompressedSize); + } + +}