Class AbstractLZ77CompressorInputStream

    • Constructor Detail

      • AbstractLZ77CompressorInputStream

        public AbstractLZ77CompressorInputStream​(InputStream is,
                                                 int windowSize)
                                          throws IOException
        Creates a new LZ77 input stream.
        Parameters:
        is - An InputStream to read compressed data from
        windowSize - Size of the window kept for back-references, must be bigger than the biggest offset expected.
        Throws:
        IOException - if reading fails
        IllegalArgumentException - if windowSize is not bigger than 0
    • Method Detail

      • getSize

        public int getSize()
        Get the uncompressed size of the stream
        Returns:
        the uncompressed size
      • prefill

        public void prefill​(byte[] data)
        Adds some initial data to fill the window with.

        This is used if the stream has been cut into blocks and back-references of one block may refer to data of the previous block(s). One such example is the LZ4 frame format using block dependency.

        Parameters:
        data - the data to fill the window with.
        Throws:
        IllegalStateException - if the stream has already started to read data
      • getCompressedCount

        public long getCompressedCount()
        Specified by:
        getCompressedCount in interface InputStreamStatistics
        Returns:
        the amount of raw or compressed bytes read by the stream
        Since:
        1.17