Class BlockLZ4CompressorOutputStream

    • Constructor Detail

      • BlockLZ4CompressorOutputStream

        public BlockLZ4CompressorOutputStream​(java.io.OutputStream out)
        Creates a new LZ4 output stream.
        Parameters:
        out - An OutputStream to read compressed data from
      • BlockLZ4CompressorOutputStream

        public BlockLZ4CompressorOutputStream​(java.io.OutputStream out,
                                              Parameters params)
        Creates a new LZ4 output stream.
        Parameters:
        out - An OutputStream to read compressed data from
        params - The parameters to use for LZ77 compression.
    • Method Detail

      • createParameterBuilder

        public static Parameters.Builder createParameterBuilder()
        Returns a builder correctly configured for the LZ4 algorithm.
        Returns:
        a builder correctly configured for the LZ4 algorithm
      • 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 CompressFilterOutputStream<java.io.OutputStream>
        Throws:
        java.io.IOException
      • finish

        public void finish()
                    throws java.io.IOException
        Compresses all remaining data and writes it to the stream, doesn't close the underlying stream.
        Overrides:
        finish in class CompressFilterOutputStream<java.io.OutputStream>
        Throws:
        java.io.IOException - if an error occurs
      • prefill

        public void prefill​(byte[] data,
                            int off,
                            int len)
        Adds some initial data to fill the window with.
        Parameters:
        data - the data to fill the window with.
        off - offset of real data into the array
        len - amount of data
        Throws:
        java.lang.IllegalStateException - if the stream has already started to write data
        See Also:
        LZ77Compressor.prefill(byte[])
      • write

        public void write​(byte[] data,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(int b)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.IOException