org.gcube.indexmanagement.common
Class DecompressingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by org.gcube.indexmanagement.common.DecompressingInputStream
All Implemented Interfaces:
Closeable

public class DecompressingInputStream
extends FilterInputStream

An InputStream used to read LZW compressed data written by a CompressingOutputStream. See http://en.wikipedia.org/wiki/LZW for an explanation of the algorithm.

Version:
0.1
See Also:
CompressingOutputStream

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
DecompressingInputStream(InputStream in)
          Constructor which wraps an input stream, and initializes the code map with all possible values of a single byte, before increasing the codesize to the size of one byte + 1 to make place for the next code
 
Method Summary
 void mark(int i)
          
 int read()
          
 int read(byte[] b)
          
 int read(byte[] b, int off, int len)
          
 void reset()
          
 long skip(long n)
          
 
Methods inherited from class java.io.FilterInputStream
available, close, markSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecompressingInputStream

public DecompressingInputStream(InputStream in)
Constructor which wraps an input stream, and initializes the code map with all possible values of a single byte, before increasing the codesize to the size of one byte + 1 to make place for the next code

Parameters:
in - - the input stream to read the compressed data from
Method Detail

read

public int read()
         throws IOException

Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException

Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException

Overrides:
read in class FilterInputStream
Throws:
IOException

mark

public void mark(int i)

Overrides:
mark in class FilterInputStream

reset

public void reset()
           throws IOException

Overrides:
reset in class FilterInputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException

Overrides:
skip in class FilterInputStream
Throws:
IOException


Copyright © 2012. All Rights Reserved.