Class ZstdOutputStreamNoFinalizer

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable

    public class ZstdOutputStreamNoFinalizer
    extends java.io.FilterOutputStream
    OutputStream filter that compresses the data using Zstd compression.
    • Constructor Detail

      • ZstdOutputStreamNoFinalizer

        public ZstdOutputStreamNoFinalizer​(java.io.OutputStream outStream,
                                           int level)
                                    throws java.io.IOException
        create a new compressing OutputStream
        Parameters:
        outStream - the stream to wrap
        level - the compression level
        Throws:
        java.io.IOException
      • ZstdOutputStreamNoFinalizer

        public ZstdOutputStreamNoFinalizer​(java.io.OutputStream outStream)
                                    throws java.io.IOException
        create a new compressing OutputStream
        Parameters:
        outStream - the stream to wrap
        Throws:
        java.io.IOException
      • ZstdOutputStreamNoFinalizer

        public ZstdOutputStreamNoFinalizer​(java.io.OutputStream outStream,
                                           BufferPool bufferPool,
                                           int level)
                                    throws java.io.IOException
        create a new compressing OutputStream
        Parameters:
        outStream - the stream to wrap
        bufferPool - the pool to fetch and return buffers
        Throws:
        java.io.IOException
      • ZstdOutputStreamNoFinalizer

        public ZstdOutputStreamNoFinalizer​(java.io.OutputStream outStream,
                                           BufferPool bufferPool)
                                    throws java.io.IOException
        create a new compressing OutputStream
        Parameters:
        outStream - the stream to wrap
        bufferPool - the pool to fetch and return buffers
        Throws:
        java.io.IOException
    • Method Detail

      • recommendedCOutSize

        public static long recommendedCOutSize()
      • setChecksum

        public ZstdOutputStreamNoFinalizer setChecksum​(boolean useChecksums)
                                                throws java.io.IOException
        Enable checksums for the compressed stream. Default: false
        Throws:
        java.io.IOException
      • setLevel

        public ZstdOutputStreamNoFinalizer setLevel​(int level)
                                             throws java.io.IOException
        Set the compression level. Default: 3
        Throws:
        java.io.IOException
      • setLong

        public ZstdOutputStreamNoFinalizer setLong​(int windowLog)
                                            throws java.io.IOException
        Enable Long Distance Matching and set the Window size Log. Values for windowLog outside the range 10-27 will disable and reset LDM
        Throws:
        java.io.IOException
      • setWorkers

        public ZstdOutputStreamNoFinalizer setWorkers​(int n)
                                               throws java.io.IOException
        Enable use of worker threads for parallel compression. Default: no worker threads.
        Throws:
        java.io.IOException
      • setCloseFrameOnFlush

        public ZstdOutputStreamNoFinalizer setCloseFrameOnFlush​(boolean closeOnFlush)
                                                         throws java.io.IOException
        Enable closing the frame on flush. This will guarantee that it can be ready fully if the process crashes before closing the stream. On the downside it will negatively affect the compression ratio. Default: false.
        Throws:
        java.io.IOException
      • write

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

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

        public void flush()
                   throws java.io.IOException
        Flushes the output
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • closeWithoutClosingParentStream

        public void closeWithoutClosingParentStream()
                                             throws java.io.IOException
        Throws:
        java.io.IOException