|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.esotericsoftware.kryo.Serializer
public abstract class Serializer
Serializes objects to and from a ByteBuffer.
Kryo.register(Class, Serializer)| Constructor Summary | |
|---|---|
Serializer()
|
|
| Method Summary | ||
|---|---|---|
boolean |
isFinal(java.lang.Class type)
Returns true if the specified type is final, or if it is an array of a final type. |
|
|
newInstance(Kryo kryo,
java.lang.Class<T> type)
Returns an instance of the specified class. |
|
|
readObject(java.nio.ByteBuffer buffer,
java.lang.Class<T> type)
Reads an object from the buffer. |
|
abstract
|
readObjectData(java.nio.ByteBuffer buffer,
java.lang.Class<T> type)
Reads an object from the buffer. |
|
void |
setCanBeNull(boolean canBeNull)
When true, a byte will not be used to denote if the object is null. |
|
void |
writeObject(java.nio.ByteBuffer buffer,
java.lang.Object object)
Writes the object to the buffer. |
|
abstract void |
writeObjectData(java.nio.ByteBuffer buffer,
java.lang.Object object)
Writes the object to the buffer. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Serializer()
| Method Detail |
|---|
public void setCanBeNull(boolean canBeNull)
public final void writeObject(java.nio.ByteBuffer buffer,
java.lang.Object object)
object - Can be null (writes a special class ID for a null object instead).
public abstract void writeObjectData(java.nio.ByteBuffer buffer,
java.lang.Object object)
object - Cannot be null.
public final <T> T readObject(java.nio.ByteBuffer buffer,
java.lang.Class<T> type)
public abstract <T> T readObjectData(java.nio.ByteBuffer buffer,
java.lang.Class<T> type)
public <T> T newInstance(Kryo kryo,
java.lang.Class<T> type)
Kryo.newInstance(Class).
SerializationException - if the class could not be constructed.public boolean isFinal(java.lang.Class type)
Kryo.isFinal(Class), allowing a subclass to customize the behavior (eg, an application may decide that all
java.util.ArrayList instances should be considered final).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||