]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.fastlz/src/org/simantics/fastlz/impl/FastLZInputStream.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.fastlz / src / org / simantics / fastlz / impl / FastLZInputStream.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.fastlz.impl;
13
14 import java.io.File;
15 import java.io.FileInputStream;
16 import java.io.FileNotFoundException;
17 import java.io.IOException;
18 import java.io.InputStream;
19 import java.nio.ByteBuffer;
20 import java.nio.channels.ReadableByteChannel;
21
22 import org.simantics.compressions.impl.DecompressingInputStream;
23 import org.simantics.fastlz.FastLZ;
24
25 /**
26  * @author Hannu Niemistö
27  */
28 public class FastLZInputStream extends DecompressingInputStream {
29
30     public FastLZInputStream(File file) throws FileNotFoundException {
31         super(file);
32     }
33
34     public FastLZInputStream(FileInputStream stream) {
35         super(stream);
36     }
37
38     public FastLZInputStream(InputStream stream) {
39         super(stream);
40     }
41
42     public FastLZInputStream(InputStream stream, ReadableByteChannel channel) {
43         super(stream, channel);
44     }
45
46     @Override
47     public void decompress(ByteBuffer compressed, int compressedOffset, int compressedSize,
48             ByteBuffer uncompressed, int uncompressedOffset, int uncompressedSize) throws IOException {
49         FastLZ.decompressBuffer(compressed, 0, compressedSize, uncompressed, 0, uncompressedSize);
50     }
51
52 }