Package com.twitter.chill
Class SerDeState
java.lang.Object
com.twitter.chill.SerDeState
This holds a Kryo Instance, Input and Output so that these
objects can be pooled and no reallocated on each serialization.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSerDeState(com.esotericsoftware.kryo.kryo5.Kryo k, com.esotericsoftware.kryo.kryo5.io.Input in, com.esotericsoftware.kryo.kryo5.io.Output out) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Call this when to reset the state to the initial statebooleanhasRegistration(Class obj) intintbyte[]<T> TreadObject(Class<T> cls) voidsetInput(byte[] in) voidsetInput(byte[] in, int offset, int count) voidsetInput(InputStream in) voidvoidvoid
-
Field Details
-
kryo
protected final com.esotericsoftware.kryo.kryo5.Kryo kryo -
input
protected final com.esotericsoftware.kryo.kryo5.io.Input input -
output
protected final com.esotericsoftware.kryo.kryo5.io.Output output
-
-
Constructor Details
-
SerDeState
protected SerDeState(com.esotericsoftware.kryo.kryo5.Kryo k, com.esotericsoftware.kryo.kryo5.io.Input in, com.esotericsoftware.kryo.kryo5.io.Output out)
-
-
Method Details
-
clear
public void clear()Call this when to reset the state to the initial state -
setInput
public void setInput(byte[] in) -
setInput
public void setInput(byte[] in, int offset, int count) -
setInput
-
numOfWrittenBytes
public int numOfWrittenBytes() -
numOfReadBytes
public int numOfReadBytes() -
readObject
-
readClassAndObject
-
writeObject
-
writeClassAndObject
-
outputToBytes
public byte[] outputToBytes() -
writeOutputTo
- Throws:
IOException
-
hasRegistration
-