Class ZCompressorInputStream

    • Constructor Detail

      • ZCompressorInputStream

        public ZCompressorInputStream​(java.io.InputStream inputStream)
                               throws java.io.IOException
        Constructs a new instance.
        Parameters:
        inputStream - The underlying input stream.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • ZCompressorInputStream

        public ZCompressorInputStream​(java.io.InputStream inputStream,
                                      int memoryLimitInKiB)
                               throws java.io.IOException
        Constructs a new instance.
        Parameters:
        inputStream - The underlying input stream.
        memoryLimitInKiB - maximum allowed estimated memory usage in kibibytes.
        Throws:
        java.io.IOException - if an I/O error occurs.
    • Method Detail

      • matches

        public static boolean matches​(byte[] signature,
                                      int length)
        Checks if the signature matches what is expected for a Unix compress file.
        Parameters:
        signature - the bytes to check
        length - the number of bytes to check
        Returns:
        true, if this stream is a Unix compress compressed stream, false otherwise
        Since:
        1.9
      • addEntry

        protected int addEntry​(int previousCode,
                               byte character)
                        throws java.io.IOException
        Add a new entry to the dictionary.

        This method is only protected for technical reasons and is not part of Commons Compress' published API. It may change or disappear without warning.

        Specified by:
        addEntry in class LZWInputStream
        Parameters:
        previousCode - the previous code
        character - the next character to append
        Returns:
        the new code
        Throws:
        java.io.IOException - on error
      • decompressNextSymbol

        protected int decompressNextSymbol()
                                    throws java.io.IOException
        Reads the next code and expand it.

        This method is only protected for technical reasons and is not part of Commons Compress' published API. It may change or disappear without warning.

        Specified by:
        decompressNextSymbol in class LZWInputStream
        Returns:
        the expanded next code, negative on EOF
        Throws:
        java.io.IOException - on error
      • readNextCode

        protected int readNextCode()
                            throws java.io.IOException
        Reads the next code from the stream.

        This method is only protected for technical reasons and is not part of Commons Compress' published API. It may change or disappear without warning.

        Overrides:
        readNextCode in class LZWInputStream
        Returns:
        the next code
        Throws:
        java.io.IOException - on error