public class DeltaOptions extends FilterOptions
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 |
---|---|
static int |
DISTANCE_MAX
Largest supported delta calculation distance.
|
static int |
DISTANCE_MIN
Smallest supported delta calculation distance.
|
Constructor and Description |
---|
DeltaOptions()
Creates 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.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
int |
getDecoderMemoryUsage()
Gets how much memory the decoder will need to decompress the data
that was encoded with these options.
|
int |
getDistance()
Gets the delta distance.
|
int |
getEncoderMemoryUsage()
Gets how much memory the encoder will need with these options.
|
InputStream |
getInputStream(InputStream in)
Gets a raw (no XZ headers) decoder input stream using these options.
|
FinishableOutputStream |
getOutputStream(FinishableOutputStream out)
Gets a raw (no XZ headers) encoder output stream using these options.
|
void |
setDistance(int distance)
Sets the delta distance in bytes.
|
getDecoderMemoryUsage, getEncoderMemoryUsage
public static final int DISTANCE_MIN
public static final int DISTANCE_MAX
public DeltaOptions()
public DeltaOptions(int distance) throws UnsupportedOptionsException
UnsupportedOptionsException
public void setDistance(int distance) throws UnsupportedOptionsException
UnsupportedOptionsException
public int getDistance()
public int getEncoderMemoryUsage()
FilterOptions
getEncoderMemoryUsage
in class FilterOptions
public FinishableOutputStream getOutputStream(FinishableOutputStream out)
FilterOptions
getOutputStream
in class FilterOptions
public int getDecoderMemoryUsage()
FilterOptions
getDecoderMemoryUsage
in class FilterOptions
public InputStream getInputStream(InputStream in)
FilterOptions
getInputStream
in class FilterOptions
Copyright © 2016 Internet2. All rights reserved.