public class DeltaCompressor extends Compressor
remote entitiy
) and only emits deltas on
subsequent serializations. Also caches bytes for the last object received (per remote
entitiy
), in order to apply deltas received.Constructor and Description |
---|
DeltaCompressor(Kryo kryo,
Serializer serializer)
Creates a DeltaCompressor with a buffer size of 2048 and a chunk size of 8.
|
DeltaCompressor(Kryo kryo,
Serializer serializer,
int bufferSize,
int chunkSize) |
Modifier and Type | Method and Description |
---|---|
void |
compress(java.nio.ByteBuffer newData,
java.lang.Object object,
java.nio.ByteBuffer outputBuffer)
The compressor should read the input buffer from the current position to the limit, compress the data, and put the result in
the output buffer.
|
void |
decompress(java.nio.ByteBuffer deltaData,
java.lang.Class type,
java.nio.ByteBuffer outputBuffer)
The compressor should read the input buffer from the current position to the limit, decompress the data, and put the result
in the output buffer.
|
readObjectData, setCompress, setDecompress, writeObjectData
isFinal, newInstance, readObject, setCanBeNull, writeObject
public DeltaCompressor(Kryo kryo, Serializer serializer)
public DeltaCompressor(Kryo kryo, Serializer serializer, int bufferSize, int chunkSize)
Delta.Delta(int, int)
public void compress(java.nio.ByteBuffer newData, java.lang.Object object, java.nio.ByteBuffer outputBuffer)
Compressor
compress
in class Compressor
outputBuffer
- A non-direct buffer.public void decompress(java.nio.ByteBuffer deltaData, java.lang.Class type, java.nio.ByteBuffer outputBuffer)
Compressor
decompress
in class Compressor
outputBuffer
- A non-direct buffer.