public class JSONCodeTableWriter extends Object implements VCDiffCodeTableWriter<Appendable>
| Constructor and Description |
|---|
JSONCodeTableWriter() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(byte[] data,
int offset,
int length)
encode an ADD opcode with the "size" length starting at offset
|
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(Appendable out)
Finishes encoding.
|
void |
init(int dictionarySize)
Initializes the constructed object for use.
|
void |
output(Appendable 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 "b".
|
void |
writeHeader(Appendable out,
EnumSet<VCDiffFormatExtension> formatExtensions)
Writes the header to the output string.
|
public void init(int dictionarySize)
VCDiffCodeTableWriterinit in interface VCDiffCodeTableWriter<Appendable>dictionarySize - size of the dictionary being usedpublic void add(byte[] data,
int offset,
int length)
VCDiffCodeTableWriteradd in interface VCDiffCodeTableWriter<Appendable>data - data to addoffset - offset in data to start fromlength - total bytes to addpublic void addChecksum(int checksum)
VCDiffCodeTableWriteraddChecksum in interface VCDiffCodeTableWriter<Appendable>checksum - checksum to write to the writerpublic void copy(int offset,
int size)
VCDiffCodeTableWritercopy in interface VCDiffCodeTableWriter<Appendable>offset - offset into the dictionary to copy data fromsize - number of bytes to copy from dictionarypublic void finishEncoding(Appendable out) throws IOException
VCDiffCodeTableWriterfinishEncoding in interface VCDiffCodeTableWriter<Appendable>out - writer mechanism to write toIOException - if there's an exception writing to outpublic void output(Appendable out) throws IOException
VCDiffCodeTableWriteroutput in interface VCDiffCodeTableWriter<Appendable>out - writer mechanism to write toIOException - if there's an exception writing to outpublic void run(int size,
byte b)
VCDiffCodeTableWriterrun in interface VCDiffCodeTableWriter<Appendable>size - number of copies of the value to writeb - byte value to writepublic void writeHeader(Appendable out, EnumSet<VCDiffFormatExtension> formatExtensions) throws IOException
VCDiffCodeTableWriterwriteHeader in interface VCDiffCodeTableWriter<Appendable>out - writer mechanism to write toformatExtensions - Flags for enabling features that are extensions to the formatIOException - if there's an exception writing to outCopyright © 2018. All rights reserved.