java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.ibm.jzos.ZCompressorInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
A subclass of
InputStream
that will expand data from
an enclosed InputStream containing data that was compressed
by the same z/Architecture compression dictionaries. Not thread safe.- Since:
- 2.4.4
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionZCompressorInputStream
(ZCompressor compressor, InputStream in) Create a new input stream with default buffer size.ZCompressorInputStream
(ZCompressor compressor, InputStream in, int buflen) Create a new input stream with the specified buffer size. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns an estimate of the number of bytes that can be read.void
close()
long
Answer the total number of bytes expanded so far.long
Answer the total number of compressed bytes read so far.void
mark
(int limit) Does nothing, not supported.boolean
Always returns false, mark/reset is not supported.int
read()
int
read
(byte[] b) int
read
(byte[] readBuf, int readBufOff, int readBufLen) void
releaseZCompressorOnClose
(boolean value) Sets a flag that will cause the ZCompressor resources to be released when this OutputStream is closed.void
reset()
This method is not supported and always throws an IOException.long
skip
(long n) This method is not supported and always throws an IOException.Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
ZCompressorInputStream
Create a new input stream with default buffer size.- Parameters:
compressor
- the ZCompressor object used to expand datain
- the InputStream containing compressed data
-
ZCompressorInputStream
Create a new input stream with the specified buffer size.- Parameters:
compressor
- the ZCompressor object used to expand datain
- the InputStream containing compressed databuflen
- the length of internal compression and expansion buffers
-
-
Method Details
-
releaseZCompressorOnClose
public void releaseZCompressorOnClose(boolean value) Sets a flag that will cause the ZCompressor resources to be released when this OutputStream is closed. Defaults tofalse
. -
getTotalSourceBytes
public long getTotalSourceBytes()Answer the total number of compressed bytes read so far.- Returns:
- the total number of compressed bytes read so far
-
getTotalExpandedBytes
public long getTotalExpandedBytes()Answer the total number of bytes expanded so far.- Returns:
- the total number of bytes expanded so far
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
- See Also:
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
- See Also:
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
- See Also:
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
- See Also:
-
skip
This method is not supported and always throws an IOException.- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
- always throws IOException since skip() is not supported- See Also:
-
available
Returns an estimate of the number of bytes that can be read. Note that this is not in any way an estimate of the amount of expanded data available. A positive integer does indicate, however that more is available.- Overrides:
available
in classFilterInputStream
- Throws:
IOException
- See Also:
-
markSupported
public boolean markSupported()Always returns false, mark/reset is not supported.- Overrides:
markSupported
in classFilterInputStream
- See Also:
-
mark
public void mark(int limit) Does nothing, not supported.- Overrides:
mark
in classFilterInputStream
- See Also:
-
reset
This method is not supported and always throws an IOException.- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
- since mark/reset is not supported- See Also:
-