Class DeltaOptions
java.lang.Object
org.graalvm.shadowed.org.tukaani.xz.FilterOptions
org.graalvm.shadowed.org.tukaani.xz.DeltaOptions
- All Implemented Interfaces:
Cloneable
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intLargest supported delta calculation distance.static final intSmallest supported delta calculation distance. -
Constructor Summary
ConstructorsConstructorDescriptionCreates new Delta options and sets the delta distance to 1 byte.DeltaOptions(int distance) Creates new Delta options and sets the distance to the given value. -
Method Summary
Modifier and TypeMethodDescriptionclone()intGets how much memory the decoder will need to decompress the data that was encoded with these options.intGets the delta distance.intGets how much memory the encoder will need with these options.getInputStream(InputStream in, ArrayCache arrayCache) Gets a raw (no XZ headers) decoder input stream using these options and the given ArrayCache.getOutputStream(FinishableOutputStream out, ArrayCache arrayCache) Gets a raw (no XZ headers) encoder output stream using these options and the given ArrayCache.voidsetDistance(int distance) Sets the delta distance in bytes.Methods inherited from class org.graalvm.shadowed.org.tukaani.xz.FilterOptions
getDecoderMemoryUsage, getEncoderMemoryUsage, getInputStream, getOutputStream
-
Field Details
-
DISTANCE_MIN
public static final int DISTANCE_MINSmallest supported delta calculation distance.- See Also:
-
DISTANCE_MAX
public static final int DISTANCE_MAXLargest supported delta calculation distance.- See Also:
-
-
Constructor Details
-
DeltaOptions
public DeltaOptions()Creates new Delta options and sets the delta distance to 1 byte. -
DeltaOptions
Creates new Delta options and sets the distance to the given value.- Throws:
UnsupportedOptionsException
-
-
Method Details
-
setDistance
Sets the delta distance in bytes. The new distance must be in the range [DISTANCE_MIN, DISTANCE_MAX].- Throws:
UnsupportedOptionsException
-
getDistance
public int getDistance()Gets the delta distance. -
getEncoderMemoryUsage
public int getEncoderMemoryUsage()Description copied from class:FilterOptionsGets how much memory the encoder will need with these options.- Specified by:
getEncoderMemoryUsagein classFilterOptions
-
getOutputStream
Description copied from class:FilterOptionsGets 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:
getOutputStreamin classFilterOptions
-
getDecoderMemoryUsage
public int getDecoderMemoryUsage()Description copied from class:FilterOptionsGets how much memory the decoder will need to decompress the data that was encoded with these options.- Specified by:
getDecoderMemoryUsagein classFilterOptions
-
getInputStream
Description copied from class:FilterOptionsGets a raw (no XZ headers) decoder input stream using these options and the given ArrayCache.- Specified by:
getInputStreamin classFilterOptions
-
clone
-