X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.fastlz%2Fsrc%2Forg%2Fsimantics%2Ffastlz%2Fimpl%2FFastLZOutputStream.java;fp=bundles%2Forg.simantics.fastlz%2Fsrc%2Forg%2Fsimantics%2Ffastlz%2Fimpl%2FFastLZOutputStream.java;h=115978d9d0eb0ad09c675acd43ec5f59d7eb0609;hp=e1f60bb840d44b5832a271fa522e19f7262b525f;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.fastlz/src/org/simantics/fastlz/impl/FastLZOutputStream.java b/bundles/org.simantics.fastlz/src/org/simantics/fastlz/impl/FastLZOutputStream.java index e1f60bb84..115978d9d 100644 --- a/bundles/org.simantics.fastlz/src/org/simantics/fastlz/impl/FastLZOutputStream.java +++ b/bundles/org.simantics.fastlz/src/org/simantics/fastlz/impl/FastLZOutputStream.java @@ -1,61 +1,61 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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.fastlz.impl; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.OutputStream; -import java.nio.ByteBuffer; -import java.nio.channels.WritableByteChannel; - -import org.simantics.compressions.impl.CompressingOutputStream; -import org.simantics.fastlz.FastLZ; - - -/** - * @author Hannu Niemistö - */ -public class FastLZOutputStream extends CompressingOutputStream { - - public FastLZOutputStream(File file) throws FileNotFoundException { - super(file); - } - - public FastLZOutputStream(FileOutputStream stream) { - super(stream); - } - - public FastLZOutputStream(OutputStream stream) { - super(stream); - } - - public FastLZOutputStream(OutputStream stream, WritableByteChannel channel) { - super(stream, channel); - } - - @Override - protected int compressBound(int inputSize) { - return FastLZ.compressBound(inputSize); - } - - @Override - protected int compress(ByteBuffer uncompressed, int uncompressedOffset, int uncompressedSize, - ByteBuffer compressed, int compressedOffset) { - return FastLZ.compressBuffer(uncompressed, uncompressedOffset, uncompressedSize, compressed, compressedOffset); - } - - protected ByteBuffer allocateBuffer(int capacity) { - return ByteBuffer.allocateDirect(capacity); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 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.fastlz.impl; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.channels.WritableByteChannel; + +import org.simantics.compressions.impl.CompressingOutputStream; +import org.simantics.fastlz.FastLZ; + + +/** + * @author Hannu Niemistö + */ +public class FastLZOutputStream extends CompressingOutputStream { + + public FastLZOutputStream(File file) throws FileNotFoundException { + super(file); + } + + public FastLZOutputStream(FileOutputStream stream) { + super(stream); + } + + public FastLZOutputStream(OutputStream stream) { + super(stream); + } + + public FastLZOutputStream(OutputStream stream, WritableByteChannel channel) { + super(stream, channel); + } + + @Override + protected int compressBound(int inputSize) { + return FastLZ.compressBound(inputSize); + } + + @Override + protected int compress(ByteBuffer uncompressed, int uncompressedOffset, int uncompressedSize, + ByteBuffer compressed, int compressedOffset) { + return FastLZ.compressBuffer(uncompressed, uncompressedOffset, uncompressedSize, compressed, compressedOffset); + } + + protected ByteBuffer allocateBuffer(int capacity) { + return ByteBuffer.allocateDirect(capacity); + } + +}