org.freehep.util.io
Class DecompressableInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.freehep.util.io.DecompressableInputStream
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
BitInputStream

public class DecompressableInputStream
extends InputStream

Special stream that can be used to read uncompressed first and compressed from a certain byte. IMPORTANT: inherits from InputStream rather than FilterInputStream so that the correct read(byte[], int, int) method is used.

Version:
$Id: DecompressableInputStream.java 8584 2006-08-10 23:06:37Z duns $
Author:
Mark Donszelmann

Constructor Summary
DecompressableInputStream(InputStream input)
          Creates a Decompressable input stream from given stream.
 
Method Summary
 int read()
           
 long skip(long n)
           
 void startDecompressing()
          Start reading in compressed mode from the next byte.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecompressableInputStream

public DecompressableInputStream(InputStream input)
Creates a Decompressable input stream from given stream.

Parameters:
input - stream to read from.
Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class InputStream
Throws:
IOException

startDecompressing

public void startDecompressing()
                        throws IOException
Start reading in compressed mode from the next byte.

Throws:
IOException - if read fails.


Copyright © 2000-2007 FreeHEP. All Rights Reserved.