public class VCDiffCodeTableWriterImpl extends Object implements VCDiffCodeTableWriter<OutputStream>
| Constructor and Description |
|---|
VCDiffCodeTableWriterImpl(boolean interleaved)
This constructor uses the default code table.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(byte[] data,
int offset,
int length)
encode an ADD opcode with the "size" bytes starting at data
|
void |
addChecksum(int checksum)
add a checksum to the code table
|
void |
copy(int offset,
int size)
encode a COPY opcode with args "offset" (into dictionary) and "size" bytes.
|
void |
finishEncoding(OutputStream out)
There should not be any need to output more data
since encodeChunk() encodes a complete target window
and there is no end-of-delta-file marker.
|
int |
getDeltaWindowSize() |
void |
init(int dictionarySize)
Initializes the constructed object for use.
|
void |
output(OutputStream out)
Appends the encoded delta window to the output
string.
|
void |
run(int size,
byte b)
encode a RUN opcode for "size" copies of the value "byte".
|
int |
targetLength() |
void |
writeHeader(OutputStream out,
EnumSet<VCDiffFormatExtension> formatExtensions)
Write the header (as defined in section 4.1 of the RFC) to *out.
|
public VCDiffCodeTableWriterImpl(boolean interleaved)
interleaved - Whether or not to interleave the output datapublic void init(int dictionarySize)
init in interface VCDiffCodeTableWriter<OutputStream>dictionarySize - size of the dictionary being usedpublic void add(byte[] data,
int offset,
int length)
add in interface VCDiffCodeTableWriter<OutputStream>data - data to addoffset - offset in data to start fromlength - total bytes to addpublic void addChecksum(int checksum)
VCDiffCodeTableWriteraddChecksum in interface VCDiffCodeTableWriter<OutputStream>checksum - checksum to write to the writerpublic void copy(int offset,
int size)
copy in interface VCDiffCodeTableWriter<OutputStream>offset - offset into the dictionary to copy data fromsize - number of bytes to copy from dictionarypublic void finishEncoding(OutputStream out) throws IOException
finishEncoding in interface VCDiffCodeTableWriter<OutputStream>out - IOException - if there's an exception writing to outpublic int getDeltaWindowSize()
public void output(OutputStream out) throws IOException
output in interface VCDiffCodeTableWriter<OutputStream>out - writer mechanism to write toIOException - if there's an exception writing to outpublic void run(int size,
byte b)
run in interface VCDiffCodeTableWriter<OutputStream>size - number of copies of the value to writeb - byte value to writepublic void writeHeader(OutputStream out, EnumSet<VCDiffFormatExtension> formatExtensions) throws IOException
writeHeader in interface VCDiffCodeTableWriter<OutputStream>out - writer mechanism to write toformatExtensions - Flags for enabling features that are extensions to the formatIOException - if there's an exception writing to outpublic int targetLength()
Copyright © 2018. All rights reserved.