X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.fastlz%2Fsrc%2Forg%2Fsimantics%2Ffastlz%2Fjava%2FFastLZJavaOutputStream.java;h=b2eab641dbc76344567625351baadd43f36a790e;hb=947cdc62f1d9a353726d29693c339edd1d0cacf6;hp=c5307da50885a094b9600b19f0c4389eed6ca304;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.fastlz/src/org/simantics/fastlz/java/FastLZJavaOutputStream.java b/bundles/org.simantics.fastlz/src/org/simantics/fastlz/java/FastLZJavaOutputStream.java index c5307da50..b2eab641d 100644 --- a/bundles/org.simantics.fastlz/src/org/simantics/fastlz/java/FastLZJavaOutputStream.java +++ b/bundles/org.simantics.fastlz/src/org/simantics/fastlz/java/FastLZJavaOutputStream.java @@ -1,63 +1,63 @@ -/******************************************************************************* - * 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.java; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.nio.ByteBuffer; -import java.nio.channels.WritableByteChannel; - -import org.simantics.compressions.impl.CompressingOutputStream; -import org.simantics.fastlz.FastLZ; -import org.simantics.fastlz.FastLZJava; - - -/** - * @author Tuukka Lehtonen - */ -public class FastLZJavaOutputStream extends CompressingOutputStream { - - public FastLZJavaOutputStream(File file) throws FileNotFoundException { - super(file); - } - - public FastLZJavaOutputStream(FileOutputStream stream) { - super(stream); - } - - public FastLZJavaOutputStream(OutputStream stream) { - super(stream); - } - - public FastLZJavaOutputStream(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) throws IOException { - return FastLZJava.compress(uncompressed.array(), 0, uncompressedSize, compressed.array(), 8); - } - - protected ByteBuffer allocateBuffer(int capacity) { - return ByteBuffer.allocate(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.java; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.channels.WritableByteChannel; + +import org.simantics.compressions.impl.CompressingOutputStream; +import org.simantics.fastlz.FastLZ; +import org.simantics.fastlz.FastLZJava; + + +/** + * @author Tuukka Lehtonen + */ +public class FastLZJavaOutputStream extends CompressingOutputStream { + + public FastLZJavaOutputStream(File file) throws FileNotFoundException { + super(file); + } + + public FastLZJavaOutputStream(FileOutputStream stream) { + super(stream); + } + + public FastLZJavaOutputStream(OutputStream stream) { + super(stream); + } + + public FastLZJavaOutputStream(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) throws IOException { + return FastLZJava.compress(uncompressed.array(), 0, uncompressedSize, compressed.array(), 8); + } + + protected ByteBuffer allocateBuffer(int capacity) { + return ByteBuffer.allocate(capacity); + } + +}