Class AbstractKryoCodec
java.lang.Object
org.springframework.integration.codec.kryo.AbstractKryoCodec
- All Implemented Interfaces:
- Codec
- Direct Known Subclasses:
- PojoCodec
- Since:
- 4.2
- Author:
- David Turanski, Artem Bilan
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final com.esotericsoftware.kryo.util.Pool<com.esotericsoftware.kryo.Kryo>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract voidconfigureKryoInstance(com.esotericsoftware.kryo.Kryo kryo) Subclasses implement this to configure the kryo instance.<T> TDecode an object of a given type.<T> Tdecode(InputStream inputStream, Class<T> type) Decode an object of a given type.protected abstract <T> TdoDecode(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input, Class<T> type) Subclasses implement this method to decode with Kryo.protected abstract voiddoEncode(com.esotericsoftware.kryo.Kryo kryo, Object object, com.esotericsoftware.kryo.io.Output output) Subclasses implement this method to encode with Kryo.byte[]Encode an object to a byte array.voidencode(Object object, OutputStream outputStream) Encode (encode) an object to an OutputStream.
- 
Field Details- 
poolprotected final com.esotericsoftware.kryo.util.Pool<com.esotericsoftware.kryo.Kryo> pool
 
- 
- 
Constructor Details- 
AbstractKryoCodecprotected AbstractKryoCodec()
 
- 
- 
Method Details- 
encodeDescription copied from interface:CodecEncode (encode) an object to an OutputStream.
- 
decodeDescription copied from interface:CodecDecode an object of a given type.- Specified by:
- decodein interface- Codec
- Type Parameters:
- T- the object's type
- Parameters:
- bytes- the byte array containing the encoded object
- type- the object's class
- Returns:
- the object
- Throws:
- IOException- if the operation fails
 
- 
decodeDescription copied from interface:CodecDecode an object of a given type.
- 
encodeDescription copied from interface:CodecEncode an object to a byte array.- Specified by:
- encodein interface- Codec
- Parameters:
- object- the object to encode
- Returns:
- the bytes
- Throws:
- IOException- if the operation fails
 
- 
doEncodeprotected abstract void doEncode(com.esotericsoftware.kryo.Kryo kryo, Object object, com.esotericsoftware.kryo.io.Output output) Subclasses implement this method to encode with Kryo.- Parameters:
- kryo- the Kryo instance
- object- the object to encode
- output- the Kryo Output instance
 
- 
doDecodeprotected abstract <T> T doDecode(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input, Class<T> type) Subclasses implement this method to decode with Kryo.- Type Parameters:
- T- the type for decoded object
- Parameters:
- kryo- the Kryo instance
- input- the Kryo Input instance
- type- the class of the decoded object
- Returns:
- the decoded object
 
- 
configureKryoInstanceprotected abstract void configureKryoInstance(com.esotericsoftware.kryo.Kryo kryo) Subclasses implement this to configure the kryo instance. This is invoked on each new Kryo instance when it is created.- Parameters:
- kryo- the Kryo instance
 
 
-