com.esotericsoftware.kryo.compress
Class Delta
java.lang.Object
com.esotericsoftware.kryo.compress.Delta
public class Delta
- extends java.lang.Object
Determines the delta to convert one ByteBuffer to another. The delta is a list of copy and append commands.
Most of this code was originally from the "javaxdelta" project. It was heavily customized for efficiency when used with Kryo.
|
Constructor Summary |
Delta()
Creates a Delta with a buffer size of 2048 and chunk size of 8. |
Delta(int bufferSize,
int chunkSize)
|
|
Method Summary |
void |
compress(java.nio.ByteBuffer sourceBuffer,
java.nio.ByteBuffer targetBuffer,
java.nio.ByteBuffer outputBuffer)
|
void |
decompress(java.nio.ByteBuffer oldData,
java.nio.ByteBuffer deltaData,
java.nio.ByteBuffer outputBuffer)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Delta
public Delta()
- Creates a Delta with a buffer size of 2048 and chunk size of 8.
Delta
public Delta(int bufferSize,
int chunkSize)
- Parameters:
bufferSize - The maximum size a serialized object may be before or after compression.chunkSize - A larger chunk size is faster and uses less memory, but creates larger deltas. The chunk size does not
affect decompress(ByteBuffer, ByteBuffer, ByteBuffer).
compress
public void compress(java.nio.ByteBuffer sourceBuffer,
java.nio.ByteBuffer targetBuffer,
java.nio.ByteBuffer outputBuffer)
decompress
public void decompress(java.nio.ByteBuffer oldData,
java.nio.ByteBuffer deltaData,
java.nio.ByteBuffer outputBuffer)
- Parameters:
oldData - Can be null if the delta does not contain copy commands.
Copyright © 2011. All Rights Reserved.