Module ibm.jzos
Package com.ibm.jzos

Class ZCompressorInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class ZCompressorInputStream
    extends java.io.FilterInputStream
    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:
    ZCompressor
    • Constructor Summary

      Constructors 
      Constructor Description
      ZCompressorInputStream​(ZCompressor compressor, java.io.InputStream in)
      Create a new input stream with default buffer size.
      ZCompressorInputStream​(ZCompressor compressor, java.io.InputStream in, int buflen)
      Create a new input stream with the specified buffer size.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()
      Returns an estimate of the number of bytes that can be read.
      void close()  
      long getTotalExpandedBytes()
      Answer the total number of bytes expanded so far.
      long getTotalSourceBytes()
      Answer the total number of compressed bytes read so far.
      void mark​(int limit)
      Does nothing, not supported.
      boolean markSupported()
      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, transferTo
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ZCompressorInputStream

        public ZCompressorInputStream​(ZCompressor compressor,
                                      java.io.InputStream in)
        Create a new input stream with default buffer size.
        Parameters:
        compressor - the ZCompressor object used to expand data
        in - the InputStream containing compressed data
      • ZCompressorInputStream

        public ZCompressorInputStream​(ZCompressor compressor,
                                      java.io.InputStream in,
                                      int buflen)
        Create a new input stream with the specified buffer size.
        Parameters:
        compressor - the ZCompressor object used to expand data
        in - the InputStream containing compressed data
        buflen - the length of internal compression and expansion buffers
    • Method Detail

      • releaseZCompressorOnClose

        public void releaseZCompressorOnClose​(boolean value)
        Sets a flag that will cause the ZCompressor resources to be released when this OutputStream is closed. Defaults to false.
      • 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

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.FilterInputStream
        Throws:
        java.io.IOException
        See Also:
        InputStream.close()
      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
        See Also:
        InputStream.read()
      • read

        public int read​(byte[] b)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
        See Also:
        InputStream.read(byte[])
      • read

        public int read​(byte[] readBuf,
                        int readBufOff,
                        int readBufLen)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
        See Also:
        InputStream.read(byte[], int, int)
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        This method is not supported and always throws an IOException.
        Overrides:
        skip in class java.io.FilterInputStream
        Throws:
        java.io.IOException - always throws IOException since skip() is not supported
        See Also:
        InputStream.skip(long)
      • available

        public int available()
                      throws java.io.IOException
        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 class java.io.FilterInputStream
        Throws:
        java.io.IOException
        See Also:
        InputStream.available()
      • markSupported

        public boolean markSupported()
        Always returns false, mark/reset is not supported.
        Overrides:
        markSupported in class java.io.FilterInputStream
        See Also:
        InputStream.markSupported()
      • mark

        public void mark​(int limit)
        Does nothing, not supported.
        Overrides:
        mark in class java.io.FilterInputStream
        See Also:
        InputStream.mark(int)
      • reset

        public void reset()
                   throws java.io.IOException
        This method is not supported and always throws an IOException.
        Overrides:
        reset in class java.io.FilterInputStream
        Throws:
        java.io.IOException - since mark/reset is not supported
        See Also:
        InputStream.reset()