|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.esotericsoftware.kryo.Serializer
com.esotericsoftware.kryo.Compressor
public abstract class Compressor
Wraps another serializer in order to modify the bytes after they are serialized and before they are deserialized.
Kryo.register(Class, Serializer)| Field Summary | |
|---|---|
protected int |
bufferSize
|
| Constructor Summary | |
|---|---|
Compressor(Serializer serializer)
Creates a compressor with compress and decompress set to true and bufferSize set to 2048. |
|
Compressor(Serializer serializer,
int bufferSize)
|
|
| Method Summary | ||
|---|---|---|
abstract void |
compress(java.nio.ByteBuffer inputBuffer,
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. |
|
abstract void |
decompress(java.nio.ByteBuffer inputBuffer,
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(java.nio.ByteBuffer buffer,
java.lang.Class<T> type)
Reads an object from the buffer. |
|
void |
setCompress(boolean compress)
Sets whether the compressor will compress data after serialization. |
|
void |
setDecompress(boolean decompress)
Sets whether the compressor will decompress data before serialization. |
|
void |
writeObjectData(java.nio.ByteBuffer buffer,
java.lang.Object object)
Writes the object to the buffer. |
|
| Methods inherited from class com.esotericsoftware.kryo.Serializer |
|---|
isFinal, newInstance, readObject, setCanBeNull, writeObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final int bufferSize
| Constructor Detail |
|---|
public Compressor(Serializer serializer)
serializer -
public Compressor(Serializer serializer,
int bufferSize)
bufferSize - The maximum size in bytes of an object that can be read or written.| Method Detail |
|---|
public void setCompress(boolean compress)
public void setDecompress(boolean decompress)
public void writeObjectData(java.nio.ByteBuffer buffer,
java.lang.Object object)
Serializer
writeObjectData in class Serializerobject - Cannot be null.
public <T> T readObjectData(java.nio.ByteBuffer buffer,
java.lang.Class<T> type)
Serializer
readObjectData in class Serializer
public abstract void compress(java.nio.ByteBuffer inputBuffer,
java.lang.Object object,
java.nio.ByteBuffer outputBuffer)
outputBuffer - A non-direct buffer.
public abstract void decompress(java.nio.ByteBuffer inputBuffer,
java.lang.Class type,
java.nio.ByteBuffer outputBuffer)
outputBuffer - A non-direct buffer.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||