public class VCDiffStreamingDecoderImpl extends Object implements VCDiffStreamingDecoder
| Modifier and Type | Class and Description |
|---|---|
protected static class |
VCDiffStreamingDecoderImpl.DecoratedByteArrayOutputStream |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAXIMUM_TARGET_FILE_SIZE
The default maximum target file size (and target window size) if
setMaximumTargetFileSize() is not called.
|
static int |
TARGET_SIZE_LIMIT
The largest value that can be passed to setMaximumTargetWindowSize().
|
static int |
UNLIMITED_BYTES
A constant that is the default value for plannedTargetFileSize,
indicating that the decoder does not have an expected length
for the target data.
|
| Constructor and Description |
|---|
VCDiffStreamingDecoderImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addToTotalTargetWindowSize(int window_size) |
boolean |
allowChecksum() |
boolean |
allowInterleaved() |
boolean |
allowVcdTarget() |
void |
decodeChunk(byte[] data,
int offset,
int len,
OutputStream out) |
void |
decodeChunk(byte[] data,
OutputStream out)
Convenience method equivalent to decodeChunk(data, 0, data.length, out)
|
void |
decodeChunk(ByteBuffer data,
OutputStream out)
Accepts "data[offset,offset+length-1]" as additional data received in the
compressed stream.
|
ByteBuffer |
dictionary_ptr() |
void |
finishDecoding()
Finishes decoding after all data has been received.
|
boolean |
hasPlannedTargetFileSize() |
boolean |
reachedPlannedTargetFileSize() |
void |
reset() |
void |
setAllowVcdTarget(boolean allowVcdTarget)
This interface must be called before startDecoding().
|
boolean |
setMaximumTargetFileSize(long newMaximumTargetFileSize)
Specifies the maximum allowable target file size.
|
boolean |
setMaximumTargetWindowSize(int newMaximumTargetWindowSize)
Specifies the maximum allowable target *window* size.
|
void |
setPlannedTargetFileSize(int planned_target_file_size) |
void |
startDecoding(byte[] dictionary) |
void |
startDecoding(ByteBuffer dictionary)
Resets the dictionary to dictionary parameter
and sets up the data structures for decoding.
|
void |
targetWindowWouldExceedSizeLimits(int window_size) |
public static final int DEFAULT_MAXIMUM_TARGET_FILE_SIZE
public static final int TARGET_SIZE_LIMIT
public static final int UNLIMITED_BYTES
public void reset()
public void startDecoding(byte[] dictionary)
startDecoding in interface VCDiffStreamingDecoderpublic void startDecoding(ByteBuffer dictionary)
VCDiffStreamingDecoderstartDecoding in interface VCDiffStreamingDecoderdictionary - dictionary the decoder is initialized withpublic void decodeChunk(byte[] data,
int offset,
int len,
OutputStream out)
throws IOException
decodeChunk in interface VCDiffStreamingDecoderdata - data to decoderoffset - offset in data to decode fromlen - number of bytes in data to decideout - OutputStream to write decoded data toIOException - if an error occurred decoding chunk or writing
the decoded chunk to outpublic void decodeChunk(ByteBuffer data, OutputStream out) throws IOException
VCDiffStreamingDecoderdecodeChunk in interface VCDiffStreamingDecoderdata - data to decoderout - OutputStream to write decoded data toIOException - if an error occurred decoding chunk or writing
the decoded chunk to outpublic void decodeChunk(byte[] data,
OutputStream out)
throws IOException
VCDiffStreamingDecoderdecodeChunk in interface VCDiffStreamingDecoderdata - data to decoderout - OutputStream to write decoded data toIOException - if an error occurred decoding chunk or writing
the decoded chunk to outpublic void finishDecoding()
throws IOException
VCDiffStreamingDecoderfinishDecoding in interface VCDiffStreamingDecoderIOException - if there's an error finishing decodingpublic boolean allowInterleaved()
public boolean allowChecksum()
public boolean setMaximumTargetFileSize(long newMaximumTargetFileSize)
VCDiffStreamingDecodersetMaximumTargetFileSize in interface VCDiffStreamingDecodernewMaximumTargetFileSize - maximum size allowed output sizepublic boolean setMaximumTargetWindowSize(int newMaximumTargetWindowSize)
VCDiffStreamingDecodersetMaximumTargetWindowSize in interface VCDiffStreamingDecodernewMaximumTargetWindowSize - maximum size of target windows allowedpublic boolean hasPlannedTargetFileSize()
public void setPlannedTargetFileSize(int planned_target_file_size)
public void addToTotalTargetWindowSize(int window_size)
public boolean reachedPlannedTargetFileSize()
public void targetWindowWouldExceedSizeLimits(int window_size)
throws IOException
IOExceptionpublic ByteBuffer dictionary_ptr()
public boolean allowVcdTarget()
public void setAllowVcdTarget(boolean allowVcdTarget)
VCDiffStreamingDecodersetAllowVcdTarget in interface VCDiffStreamingDecoderallowVcdTarget - whether or not to allow the decoder to use decoded VCD
data as a targetCopyright © 2018. All rights reserved.