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.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| public static final int | DISTANCE_MAX
Largest supported delta calculation distance. |
| public static final int | DISTANCE_MIN
Smallest supported delta calculation distance. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public int | getDecoderMemoryUsage()
Implements abstract org. |
| public int | |
| public int | getEncoderMemoryUsage()
Implements abstract org. |
| pack-priv FilterEncoder | |
| public InputStream | getInputStream(InputStream in, ArrayCache arrayCache)
Implements abstract org. |
| public FinishableOutputStream | getOutputStream(FinishableOutputStream out, ArrayCache arrayCache)
Implements abstract org. |
| public void |
| distance | back to summary |
|---|---|
| private int distance | |
| DISTANCE_MAX | back to summary |
|---|---|
| public static final int DISTANCE_MAX Largest supported delta calculation distance. | |
| DISTANCE_MIN | back to summary |
|---|---|
| public static final int DISTANCE_MIN Smallest supported delta calculation distance. | |
| DeltaOptions | back to summary |
|---|---|
| public DeltaOptions() Creates new Delta options and sets the delta distance to 1 byte. | |
| DeltaOptions | back to summary |
|---|---|
| public DeltaOptions(int distance) throws UnsupportedOptionsException Creates new Delta options and sets the distance to the given value. | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| getDecoderMemoryUsage | back to summary |
|---|---|
| public int getDecoderMemoryUsage() Implements abstract org. Doc from org. Gets how much memory the decoder will need to decompress the data that was encoded with these options. | |
| getDistance | back to summary |
|---|---|
| public int getDistance() Gets the delta distance. | |
| getEncoderMemoryUsage | back to summary |
|---|---|
| public int getEncoderMemoryUsage() Implements abstract org. Doc from org. Gets how much memory the encoder will need with these options. | |
| getFilterEncoder | back to summary |
|---|---|
| pack-priv FilterEncoder getFilterEncoder() Implements abstract org. | |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream(InputStream in, ArrayCache arrayCache) Implements abstract org. Doc from org. Gets a raw (no XZ headers) decoder input stream using these options and the given ArrayCache. | |
| getOutputStream | back to summary |
|---|---|
| public FinishableOutputStream getOutputStream(FinishableOutputStream out, ArrayCache arrayCache) Implements abstract org. Doc from org. 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. | |
| setDistance | back to summary |
|---|---|
| public void setDistance(int distance) throws UnsupportedOptionsException Sets the delta distance in bytes. The new distance must be in the range [DISTANCE_MIN, DISTANCE_MAX]. | |