|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.esotericsoftware.kryo.Context
public class Context
Serves as thread local storage for serializers. A serializer instance can be used by multiple threads simultaneously, so should be thread safe. This class provides scratch buffers and object storage that serializers can use to remain thread safe.
Kryo.getContext()| Constructor Summary | |
|---|---|
Context()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
get(Serializer serializer,
java.lang.String key)
Returns an object for a serializer instance from thread local storage, or null. |
java.lang.Object |
get(java.lang.String key)
Returns an object from thread local storage, or null. |
java.nio.ByteBuffer |
getBuffer(int minimumSize)
Returns a non-direct buffer of at least the specified size. |
java.util.ArrayList<java.nio.ByteBuffer> |
getBuffers(int count,
int minimumSize)
Returns a list containing at least the specified number of non-direct buffers, each at least the specified size. |
byte[] |
getByteArray(int minimumSize)
Returns a byte array of at least the specified size. |
char[] |
getCharArray(int minimumSize)
Returns a char array of at least the specified size. |
int[] |
getIntArray(int minimumSize)
Returns an int array of at least the specified size. |
int |
getRemoteEntityID()
Returns an identifier for the entity that either sent the serialized data or will be receiving the serialized data. |
java.lang.Object |
getTemp(Serializer serializer,
java.lang.String key)
Returns a temporary object for a serializer instance from thread local storage, or null. |
java.lang.Object |
getTemp(java.lang.String key)
Returns a temporary object from thread local storage, or null. |
void |
put(Serializer serializer,
java.lang.String key,
java.lang.Object value)
Stores an object for a serializer instance in thread local storage. |
void |
put(java.lang.String key,
java.lang.Object value)
Stores an object in thread local storage. |
void |
putTemp(Serializer serializer,
java.lang.String key,
java.lang.Object value)
Stores a temporary object for a serializer instance in thread local storage. |
void |
putTemp(java.lang.String key,
java.lang.Object value)
Stores a temporary object in thread local storage. |
void |
reset()
Clears temporary values that are only needed for serialization or deserialization per object graph. |
void |
setRemoteEntityID(int remoteEntityID)
Sets the remote entity ID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Context()
| Method Detail |
|---|
public java.nio.ByteBuffer getBuffer(int minimumSize)
public java.util.ArrayList<java.nio.ByteBuffer> getBuffers(int count,
int minimumSize)
public char[] getCharArray(int minimumSize)
public int[] getIntArray(int minimumSize)
public byte[] getByteArray(int minimumSize)
public void put(java.lang.String key,
java.lang.Object value)
public java.lang.Object get(java.lang.String key)
put(Serializer, String, Object)
public void put(Serializer serializer,
java.lang.String key,
java.lang.Object value)
public java.lang.Object get(Serializer serializer,
java.lang.String key)
put(Serializer, String, Object)
public void putTemp(java.lang.String key,
java.lang.Object value)
public java.lang.Object getTemp(java.lang.String key)
put(Serializer, String, Object)
public void putTemp(Serializer serializer,
java.lang.String key,
java.lang.Object value)
public java.lang.Object getTemp(Serializer serializer,
java.lang.String key)
put(Serializer, String, Object)public void reset()
Kryo read and write methods, the context is automatically reset after an entire object graph is serialized or
deserialized.
public int getRemoteEntityID()
DeltaCompressor.
Kryo.addListener(Kryo.Listener)public void setRemoteEntityID(int remoteEntityID)
getRemoteEntityID()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||