Package com.gengoai.io
Class CompressedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.gengoai.io.CompressedInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class CompressedInputStream extends InputStream
An InputStream implementation that is associated with aCompression
algorithm for decompressing the incoming bytes.- Author:
- David B. Bracewell
-
-
Constructor Summary
Constructors Constructor Description CompressedInputStream(InputStream backing, Compression compression)
Instantiates a new CompressedInputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Compression
getCompression()
Gets the Compression algorithm used.int
read()
-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
CompressedInputStream
public CompressedInputStream(InputStream backing, Compression compression) throws IOException
Instantiates a new CompressedInputStream.- Parameters:
backing
- the backing InputStream to decompresscompression
- the compression algorithm to use- Throws:
IOException
- Something went wrong wrapping the backing InputStream
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
getCompression
public Compression getCompression()
Gets the Compression algorithm used.- Returns:
- the compression
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
-