Class DeltaOptions

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class DeltaOptions
    extends FilterOptions
    Delta filter options. The Delta filter can be used only as a non-last filter in the chain, for example Delta + LZMA2.

    Currently only simple byte-wise delta is supported. The only option is the delta distance, which you should set to match your data. It's not possible to provide a generic default value for it.

    For example, with distance = 2 and eight-byte input A1 B1 A2 B3 A3 B5 A4 B7, the output will be A1 B1 01 02 01 02 01 02.

    The Delta filter can be good with uncompressed bitmap images. It can also help with PCM audio, although special-purpose compressors like FLAC will give much smaller result at much better compression speed.

    • Field Detail

      • DISTANCE_MIN

        public static final int DISTANCE_MIN
        Smallest supported delta calculation distance.
        See Also:
        Constant Field Values
      • DISTANCE_MAX

        public static final int DISTANCE_MAX
        Largest supported delta calculation distance.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DeltaOptions

        public DeltaOptions()
        Creates new Delta options and sets the delta distance to 1 byte.
    • Method Detail

      • getDistance

        public int getDistance()
        Gets the delta distance.
      • getOutputStream

        public FinishableOutputStream getOutputStream​(FinishableOutputStream out,
                                                      ArrayCache arrayCache)
        Description copied from class: FilterOptions
        Gets a raw (no XZ headers) encoder output stream using these options and the given ArrayCache. Raw streams are an advanced feature. In most cases you want to store the compressed data in the .xz container format instead of using a raw stream. To use this filter in a .xz file, pass this object to XZOutputStream.
        Specified by:
        getOutputStream in class FilterOptions
      • getDecoderMemoryUsage

        public int getDecoderMemoryUsage()
        Description copied from class: FilterOptions
        Gets how much memory the decoder will need to decompress the data that was encoded with these options.
        Specified by:
        getDecoderMemoryUsage in class FilterOptions
      • getInputStream

        public java.io.InputStream getInputStream​(java.io.InputStream in,
                                                  ArrayCache arrayCache)
        Description copied from class: FilterOptions
        Gets a raw (no XZ headers) decoder input stream using these options and the given ArrayCache.
        Specified by:
        getInputStream in class FilterOptions
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object