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.
限定符和类型 | 字段和说明 |
---|---|
static int |
DISTANCE_MAX
Largest supported delta calculation distance.
|
static int |
DISTANCE_MIN
Smallest supported delta calculation distance.
|
构造器和说明 |
---|
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.
|
限定符和类型 | 方法和说明 |
---|---|
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
public void setDistance(int distance) throws UnsupportedOptionsException
public int getDistance()
public int getEncoderMemoryUsage()
FilterOptions
getEncoderMemoryUsage
在类中 FilterOptions
public FinishableOutputStream getOutputStream(FinishableOutputStream out)
FilterOptions
getOutputStream
在类中 FilterOptions
public int getDecoderMemoryUsage()
FilterOptions
getDecoderMemoryUsage
在类中 FilterOptions
public InputStream getInputStream(InputStream in)
FilterOptions
getInputStream
在类中 FilterOptions